Meta / Facebook

How to setup and use meta to track key events across your selling experience.

Overview

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

1. Create A Tracking Pixel Within Different Breed

You can find the location to define tracking pixels on Different Breed by accesing the following from your event: Marketing > Tracking Pixels. Once loaded, click Create Pixel, select Google Analytics or Google Adwords 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

    2. Initiate Checkout

    3. Purchase

    4. Add To Cart

  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 Measurment Secret field on Different Breed.

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

5. Select Events To Track

On the Different Breed Tracking Pixel 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 NameGA4 EventDescription

View Content

ViewContent

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

Add To Cart

AddToCart

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

Begin Checkout

InitiateCheckout

Tracks when the customer begins to checkout with their cart.

Complete Purchase

Purchase

Tracks when a customer completes checkout successfully.

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 NameGA4 EventDescription

Promo Code Redeemed

PromoCodeEntered

Tracks when a customer enters a promo code.

Remove From Cart

RemoveFromCart

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

Campaign

Campaign

Tracks a traditional UTM style campaign.

Manual Order Claimed

ManualOrderClaimed

Tracks when a manual order has been claimed by a customer.

6. Save Your Pixel

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


Test Your Tracking Pixel

To test your tracking pixel, 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 pixel 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;
};
FieldTypeDescription

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 Google Analytics contain the following structure and properties:

FieldTypeDescription

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_event_id

string

The id of the event you are selling for on Different Breed.

View Content / Page View

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

  • Event Listing

  • Checkout

  • Order Confirmation

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_event_id: string;
  };
  user_data: MetaUserData;
};
FieldTypeDescription

page_location

string

The url of the page sending the event.

page_title

string

The title of the page sending the event.

db_event_id

string (uuid)

The id of the event you are selling for on Different Breed.

Promo Code Entered

Tracks when a customer enters a promo code.

Payload Sent
export type MetaPromoCodeEnteredPayload = {
  event_name: 'PromoCodeEntered';
  event_time: number;
  event_source_url: string;
  action_source: string;
  event_id: string;
  custom_data: {
    promotion_id: string;
    promotion_name: string;
    db_event_id: string;
    page_location: string;
    page_title: string;
  };
  user_data: MetaUserData;
};
FieldTypeDescription

promotion_id

string

The promotional code applied.

promotion_name

string

The promotional code applied.

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_event_id: string;
  };
  user_data: MetaUserData;
};
FieldTypeDescription

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.

Manual Order Claimed

Tracks when a manual order has been claimed by a customer.

Payload Sent
export type MetaManualOrderClaimedPayload = {
  event_name: 'ManualOrderClaimed';
  event_time: number;
  event_source_url: string;
  action_source: string;
  event_id: string;
  custom_data: {
    manual_order_id: string;
    manual_order_reference: string;
    db_event_id: string;
    page_location: string;
    page_title: string;
  };
  user_data: MetaUserData;
};
FieldTypeDescription

manual_order_id

string(uuid)

ID of the manual order claimed.

manual_order_reference

string

The claim code used.

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;
};
FieldTypeDescription

value

number

The total value of items added.

currency

string

The ISO currency code used.

content_ids

array

Array of content ids.

contents

array

List of items added to cart.

contents[0].id

string

The ticket or add-on id.

contents[0].quantity

number

Number added, This will always be 1.

contents[0].item_price

number

Price of the item with discounts applied.

item_ids

array

Array of ids from the items.

items

array

List of items added to the cart.

items[0].id

string(uuid)

The ticket or add-on id.

items[0].item_brand

string

Tickets or Add-ons

items[0].item_name

string

Ticket or Add-on name.

items[0].item_variant

string

Addon variant name.

items[0].item_category

string

ticket or addon

items[0].item_list_name

string

Tickets or Add-ons

items[0].coupon

string

Promo code used.

items[0].discount

number

The amount discounted from the original price.

items[0].item_price

number

Price of the item with discounts applied.

items[0].quantity

number

Number added, This will always be 1.

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;
};
FieldTypeDescription

value

number

The total value of items added.

currency

string

The ISO currency code used.

content_ids

array

Array of content ids.

contents

array

List of items added to cart.

contents[0].id

string

The ticket or add-on id.

contents[0].quantity

number

Number added, This will always be 1.

contents[0].item_price

number

Price of the item with discounts applied.

item_ids

array

Array of ids from the items.

items

array

List of items added to the cart.

items[0].id

string(uuid)

The ticket or add-on id.

items[0].item_brand

string

Tickets or Add-ons

items[0].item_name

string

Ticket or Add-on name.

items[0].item_variant

string

Addon variant name.

items[0].item_category

string

ticket or addon

items[0].item_list_name

string

Tickets or Add-ons

items[0].coupon

string

Promo code used.

items[0].discount

number

The amount discounted from the original price.

items[0].item_price

number

Price of the item with discounts applied.

items[0].quantity

number

Number added, This will always be 1.

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;
};
FieldTypeDescription

value

number

The total value of items added.

currency

string

The ISO currency code used.

transaction_id

string(uuid)

The cart id.

content_ids

array

Array of content ids.

contents

array

List of items added to cart.

contents[0].id

string

The ticket or add-on id.

contents[0].quantity

number

Number added, This will always be 1.

contents[0].item_price

number

Price of the item with discounts applied.

item_ids

array

Array of ids from the items.

items

array

List of items added to the cart.

items[0].id

string(uuid)

The ticket or add-on id.

items[0].item_brand

string

Tickets or Add-ons

items[0].item_name

string

Ticket or Add-on name.

items[0].item_variant

string

Addon variant name.

items[0].item_category

string

ticket or addon

items[0].item_list_name

string

Tickets or Add-ons

items[0].coupon

string

Promo code used.

items[0].discount

number

The amount discounted from the original price.

items[0].item_price

number

Price of the item with discounts applied.

items[0].quantity

number

Number added, This will always be 1.

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;
};
FieldTypeDescription

value

number

The total value of items added.

currency

string

The ISO currency code used.

transaction_id

string(uuid)

The cart id.

content_ids

array

Array of content ids.

contents

array

List of items added to cart.

contents[0].id

string

The ticket or add-on id.

contents[0].quantity

number

Number added, This will always be 1.

contents[0].item_price

number

Price of the item with discounts applied.

item_ids

array

Array of ids from the items.

items

array

List of items added to the cart.

items[0].id

string(uuid)

The ticket or add-on id.

items[0].item_brand

string

Tickets or Add-ons

items[0].item_name

string

Ticket or Add-on name.

items[0].item_variant

string

Addon variant name.

items[0].item_category

string

ticket or addon

items[0].item_list_name

string

Tickets or Add-ons

items[0].coupon

string

Promo code used.

items[0].discount

number

The amount discounted from the original price.

items[0].item_price

number

Price of the item with discounts applied.

items[0].quantity

number

Number added, This will always be 1.

Last updated