Meta / Facebook

How to setup and use Meta to track key events across your guides experience.

Overview

The following guide will outline the steps required to set up Meta for use with Different Breed.

1. Create A Tracking Source Within Different Breed

You can find the location to define measurement tracking on Different Breed by accessing the following from your guides landing page: Metrics > Tracking. Once loaded, click Create Source, select Meta as the provider and follow the next steps.

2. Create a new Data Source within Meta Events Manager.

Within Meta Events Manager:

  1. Click "Connect Data Sources" in the sidebar menu and then click Web.

  2. Provide the data set a name e.g "My Event Name".

  3. Click connect manually > Meta pixel and Conversions API.

  4. Copy the dataset id from the bottom of the modal. e.g. 1014278576603089 into the field Measurement ID on Different Breed.

  5. Click Next

  6. A Modal will show, Select "See Instructions" under Conversions API.

  7. Close the modal when the manual implementation window shows.

3. Configure Your Conversion Events

Now we need to set up the conversions API:

  1. Click continue to select your events.

  2. Drop down additional events and select the following:

    1. View Content

  3. Once selected navigate through each selected event and tick the following events:

    1. Value

    2. Event ID

    3. Contents

    4. Currency

    5. Phone Number

    6. Email Address

  4. Once all events are configured, click continue then confirm setup.

  5. Finally click "Open implementation guide" from the final page and click Finish.

4. Create Your Measurement Protocol Secret

Navigate to the implementation guide opened in the previous step and action the following:

  1. Scroll to "Generate an access token"

  2. Click Generate Access Token

  3. Copy the generated value into the Measurement Secret field on Different Breed.

  4. Scroll to the bottom and click "Finish".

5. Select Events To Track

On the Different Breed Tracking Source form you are presented with a number of events and page views you can track. While the majority of these are standard events and do not require additional set up, a few will require custom events to be created to get the most of our your reports.

Standard Events

Custom Events

Custom events will be sent without needing to be configured. For some events you may see a warning pop up within the Meta UI requesting that you allow the events to be collected for legitimate purposes, Simply review this message and click approve on each event.

6. Save Your Tracking Source

Once you have selected your desired events, simply save the source and the tracking events will begin to fire.


Test Your Tracking Pixel

To test your tracking, navigate to the "Test Events" tab within meta. Within this view you will see a Test id formatted like so: TEST1234, Copy this ID and paste it within the Different Breed tracking source form to enable debug mode.

Once enabled you will be able to see test events logged within meta. Please note these may take up to a minute to start showing.


Breakdown Of Events We Send

User Data

All the events we send will contain the following user data.

Payload Sent
type MetaUserData = {
  em?: string[];
  ph?: string[];
  client_ip_address: string;
  client_user_agent: string;
  fbc: string;
  fbp: string;
};

Event Structure

All the events we send to Google Analytics contain the following structure and properties:

View Content / Page View

Tracks a customer landing on a desired page during the selling experience. The following pages are supported:

  • Guide Filters

  • Guide Content

For each page view you enable we will send the following data structure to Google Analytics:

Payload Sent
export type MetaPageViewPayload = {
  event_name: 'ViewContent';
  event_time: number;
  event_source_url: string;
  action_source: string;
  event_id: string;
  custom_data: {
    page_location: string;
    page_title: string;
    db_guide_id: string;
  };
  user_data: MetaUserData;
};

Campaign

Tracks a traditional utm style campaign. To track this effectively your URL parameters should be formatted in the following way:

?utm_source=hubspot&utm_medium=email&utm_campaign=spring_sale&utm_id=campID&utm_term=term1%2C+term2&utm_content=content_xyz

Google have a useful tool to help with this: https://ga-dev-tools.google/ga4/campaign-url-builder/

This will enable us to send the following data structure to Meta Analytics:

Payload Sent
export type CampaignData = {
  campaign_id: string;
  campaign: string | null;
  source: string | null;
  medium: string | null;
  term: string | null;
  content: string | null;
};

export type MetaCampaignPayload = {
  event_name: 'Campaign';
  event_time: number;
  event_source_url: string;
  action_source: string;
  event_id: string;
  custom_data: CampaignData & {
    page_location: string;
    page_title: string;
    db_guide_id: string;
  };
  user_data: MetaUserData;
};

Filters Applied

Tracks when a user applies filters to the guide.

Payload Sent
export type GuideFiltersAppliedPayload = {
  event_name: 'GuideFiltersApplied';
  event_time: number;
  event_source_url: string;
  action_source: string;
  event_id: string;
  custom_data: {
    ticket_puchased: boolean;
    visual_impairments: boolean;
    hearing_impairments: boolean;
    mobility_physical_disabilities: boolean;
    chronic_illnesses_fatigue: boolean;
    mental_health_emotional: boolean;
    speech_communication: boolean;
    neurodivergent_sensory: boolean;
    cognitive_disabilities: boolean;
    db_guide_id: string;
    page_location: string;
    page_title: string;
  };
  user_data: MetaUserData;
};

Add To Cart

Tracks when a customer adds a ticket or an add-on to the cart.

Payload Sent
export type MetaAddToCartPayload = {
  event_name: 'AddToCart';
  event_time: number;
  event_source_url: string;
  action_source: string;
  event_id: string;
  custom_data: {
    currency: GenericModels.CurrencyCodes.CurrencyCode['code'];
    value: number;
    content_ids: string[];
    contents: {
      id: string;
      quantity: number;
      item_price: number;
    }[];
    item_ids: string[];
    items: {
      id: string;
      quantity: number;
      item_price: number;
      item_name: string;
      item_brand: string;
      item_variant: string;
      item_category: string;
      item_list_name: string;
      coupon?: string;
      discount?: number;
    }[];
    db_event_id: string;
    page_location: string;
    page_title: string;
  };
  user_data: MetaUserData;
};

Remove From Cart

Tracks when a customer removes a ticket or add-on from the cart.

Payload Sent
export type MetaRemoveFromCartPayload = {
  event_name: 'RemoveFromCart';
  event_time: number;
  event_source_url: string;
  action_source: string;
  event_id: string;
  custom_data: {
    currency: GenericModels.CurrencyCodes.CurrencyCode['code'];
    value: number;
    content_ids: string[];
    contents: {
      id: string;
      quantity: number;
      item_price: number;
    }[];
    item_ids: string[];
    items: {
      id: string;
      quantity: number;
      item_price: number;
      item_name: string;
      item_brand: string;
      item_variant: string;
      item_category: string;
      item_list_name: string;
      coupon?: string;
      discount?: number;
    }[];
    db_event_id: string;
    page_location: string;
    page_title: string;
  };
  user_data: MetaUserData;
};

Begin Checkout

Tracks when the customer begins to checkout with their cart.

Payload Sent
export type MetaBeginCheckoutPayload = {
  event_name: 'InitiateCheckout';
  event_time: number;
  event_source_url: string;
  action_source: string;
  event_id: string;
  custom_data: {
    currency: GenericModels.CurrencyCodes.CurrencyCode['code'];
    value: number;
    transaction_id: string;
    content_ids: string[];
    contents: {
      id: string;
      quantity: number;
      item_price: number;
    }[];
    item_ids: string[];
    items: {
      id: string;
      quantity: number;
      item_price: number;
      item_name: string;
      item_brand: string;
      item_variant: string;
      item_category: string;
      item_list_name: string;
      coupon?: string;
      discount?: number;
    }[];
    db_event_id: string;
    page_location: string;
    page_title: string;
  };
  user_data: MetaUserData;
};

Complete Purchase

Tracks when a customer completes checkout successfully.

Payload Sent
export type MetaCompletePurchasePayload = {
  event_name: 'Purchase';
  event_time: number;
  event_source_url: string;
  action_source: string;
  event_id: string;
  custom_data: {
    currency: GenericModels.CurrencyCodes.CurrencyCode['code'];
    value: number;
    transaction_id: string;
    content_ids: string[];
    contents: {
      id: string;
      quantity: number;
      item_price: number;
    }[];
    item_ids: string[];
    items: {
      id: string;
      quantity: number;
      item_price: number;
      item_name: string;
      item_brand: string;
      item_variant: string;
      item_category: string;
      item_list_name: string;
      coupon?: string;
      discount?: number;
    }[];
    db_event_id: string;
    page_location: string;
    page_title: string;
  };
  user_data: MetaUserData;
};

Last updated