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

Event Name
GA4 Event
Description

View Content

ViewContent

Tracks a customer landing on a desired page during the guides experience.

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.

Event Name
GA4 Event
Description

Campaign

Campaign

Tracks a traditional UTM style campaign.

Filters Applied

GuideFiltersApplied

Tracks when a user applies filters to the guide.

Share Clicked

GuideShareClicked

Tracks when a user clicks to share the guide.

Print Clicked

GuidePrintClicked

Tracks when a user clicks to print the guide.

Feedback Initiated

GuideFeedbackInitiated

Tracks when a user clicks to provide feedback.

Feedback Submitted

GuideFeedbackSubmitted

Tracks when a user clicks to submit feedback.

Guide Search Clicked

GuideSearchClicked

Tracks when opens the in page search feature.

Guide Search Terms

GuideSearchTerms

Tracks the users entered search terms.

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;
};
Field
Type
Description

em

array

Array of encrypted email addresses.

ph

array

Array of encrypted phone numbers. (This will always be blank).

client_ip_address

string

The IP address of the client making the request, used to identify the geographic location of the user.

client_user_agent

string

The User-Agent string of the user's browser, which provides information about the browser type, version, and operating system.

fbc

string

Facebook click id if provided in URL.

fbp

string

Facebook browser id. We generate this once per user and retain across sessions.

Event Structure

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

Field
Type
Description

event_name

string

Name of the event

event_id

string(uuid)

Unique id for the event.

event_time

number

The date in unix when the event occurred.

event_source_url

string

The page url the event was fired on.

action_source

string

The location of the event. This will always be "website".

custom_data

Array

An array of items to be processed.

page_title

string

The title of the page sending the event.

page_location

string

The url of the page sending the event.

db_guide_id

string

The id of the guide you have created within Different Breed.

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 Meta:

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;
};
Field
Type
Description

page_location

string

The url of the page sending the event.

page_title

string

The title of the page sending the event.

db_guide_id

string (uuid)

The id of the guide you have created within Different Breed.

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;
};
Field
Type
Description

campaign_id

string

The provided campaign id from the url.

campaign

string

The provided campaign from the url.

source

string

The provided source from the url.

medium

string

The provided medium from the url.

term

string

The provided term from the url.

content

string

The provided content from the url.

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;
};
Field
Type
Description

ticket_puchased

boolean

Indicates if the user has purchased a ticket.

visual_impairments

boolean

Indicates the user has filtered for visual impairments.

hearing_impairments

boolean

Indicates the user has filtered for hearing impairments.

mobility_physical_disabilities

boolean

Indicates the user has filtered for mobility impairments.

chronic_illnesses_fatigue

boolean

Indicates the user has filtered for chronic illness needs.

mental_health_emotional

boolean

Indicates the user has filtered for mental health needs.

speech_communication

boolean

Indicates the user has filtered for speech impairments.

neurodivergent_sensory

boolean

Indicates the user has filtered for neurodiverse needs.

cognitive_disabilities

boolean

Indicates the user has filtered for cognative disabilities.

Share Clicked

Tracks when a customer clicks to share the guide.

Payload Sent
export type MetaGuideShareClickedPayload = {
  event_id: string;
  event_name: 'GuideShareClicked';
  event_time: number;
  event_source_url: string;
  action_source: string;
  custom_data: {
    page_location: string;
    page_title: string;
    db_guide_id: string;
  };
  user_data: MetaUserData;
};
Field
Type
Description

page_location

string

The url of the page sending the event.

page_title

string

The title of the page sending the event.

db_guide_id

string (uuid)

The id of the guide you have created within Different Breed.

Tracks when a customer clicks to print the guide.

Payload Sent
export type MetaGuidePrintClickedPayload = {
  event_id: string;
  event_name: 'GuidePrintClicked';
  event_time: number;
  event_source_url: string;
  action_source: string;
  custom_data: {
    page_location: string;
    page_title: string;
    db_guide_id: string;
  };
  user_data: MetaUserData;
};
Field
Type
Description

page_location

string

The url of the page sending the event.

page_title

string

The title of the page sending the event.

db_guide_id

string (uuid)

The id of the guide you have created within Different Breed.

Feedback Initiated

Tracks when the customer opens the feedback modal.

Payload Sent
export type MetaGuideFeedbackInitiatedPayload = {
  event_id: string;
  event_name: 'GuideFeedbackInitiated';
  event_time: number;
  event_source_url: string;
  action_source: string;
  custom_data: {
    page_location: string;
    page_title: string;
    db_guide_id: string;
  };
  user_data: MetaUserData;
};
Field
Type
Description

page_location

string

The url of the page sending the event.

page_title

string

The title of the page sending the event.

db_guide_id

string (uuid)

The id of the guide you have created within Different Breed.

Feedback Submitted

Tracks when the customer submits their feedback.

Payload Sent
export type MetaGuideFeedbackSubmittedPayload = {
  event_id: string;
  event_name: 'GuideFeedbackSubmitted';
  event_time: number;
  event_source_url: string;
  action_source: string;
  custom_data: {
    page_location: string;
    page_title: string;
    db_guide_id: string;
  };
  user_data: MetaUserData;
};
Field
Type
Description

page_location

string

The url of the page sending the event.

page_title

string

The title of the page sending the event.

db_guide_id

string (uuid)

The id of the guide you have created within Different Breed.

Search Clicked

Tracks when the customer opens the search feature.

Payload Sent
export type MetaGuideSearchClickedPayload = {
  event_id: string;
  event_name: 'GuideSearchClicked';
  event_time: number;
  event_source_url: string;
  action_source: string;
  custom_data: {
    page_location: string;
    page_title: string;
    db_guide_id: string;
  };
  user_data: MetaUserData;
};
Field
Type
Description

page_location

string

The url of the page sending the event.

page_title

string

The title of the page sending the event.

db_guide_id

string (uuid)

The id of the guide you have created within Different Breed.

Search Terms

Tracks when a customer enters a search query within the guide.

Payload Sent
export type MetaGuideSearchTermsPayload = {
  event_id: string;
  event_name: 'GuideSearchTerms';
  event_time: number;
  event_source_url: string;
  action_source: string;
  custom_data: BaseGuideSearchTermsData & { search_terms: string[] };
  user_data: MetaUserData;
};
Field
Type
Description

page_location

string

The url of the page sending the event.

page_title

string

The title of the page sending the event.

db_guide_id

string (uuid)

The id of the guide you have created within Different Breed.

search_terms

string[]

The terms entered for the search. i.e ['test', 'term']

Last updated