Google Analytics

How to setup and use google analytics 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 Google Analytics 4 property.

Eventbrite is unable to assist with setting up your Google Analytics property. If you need help with this step, follow these steps from Google’s Help Center.

3. Copy your measurement ID.

For websites, a Measurement ID can be used to send data to your Google Analytics 4 property through an associated web data stream (similar to a Tracking ID in Universal Analytics properties). Find your Measurement ID in Admin > Data Streams.

Once found, past the value into the "Measurement ID" field.

NOTE: If you’re still using Universal Google Analytics, you will need to upgrade to Google Analytics v4 to enable tracking on Different Breed.

4. Create your measurement protocol secret

To create a new secret, navigate in the Google Analytics UI to: Admin > Data Streams > choose your stream > Measurement Protocol > Create

Once created copy the secret value and paste it into the "Measurement Secret" field.

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

Custom Events

To create a new custom event, navigate in the Google Analytics UI to: Admin > Data Streams > choose your stream > Measurement Protocol > Create

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, Simply view the Real Time Reporting view within your Google Analytics UI. Once you have the rea time reporting view loaded, navigate your event page and trigger the enabled events to see them appear in the UI.


Breakdown Of Events We Send

User Data

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

Payload Sent
type GA4UserData = {
  user_agent: string;
  client_ip: string;
  client_id: string;
  gclid: string;
  engagement_time_msec: number;
};

For the purpose of having the active users logged, we set engagement_time_msec to 1 in every tracking event we send.

Event Structure

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

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 GA4PageViewPayload = {
  client_id: string;
  events: {
    name: 'page_view';
    params: GA4UserData & {
      page_location: string;
      page_title: string;
      db_event_id: string;
    };
  }[];
};

Promo Code Entered

Tracks when a customer enters a promo code.

Payload Sent
export type GA4PromoCodeEnteredPayload = {
  client_id: string;
  events: {
    name: 'promo_code_entered';
    params: GA4UserData & {
      promotion_id: string;
      promotion_name: string;
      page_location: string;
      page_title: string;
      db_event_id: string;
    };
  }[];
};

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 Google 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 GA4CampaignPayload = {
  client_id: string;
  events: {
    name: 'campaign';
    params: GA4UserData &
      CampaignData & {
        page_location: string;
        page_title: string;
        db_event_id: string;
      };
  }[];
};

Manual Order Claimed

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

Payload Sent
export type GA4ManualOrderClaimedPayload = {
  client_id: string;
  events: {
    name: 'manual_order_claimed';
    params: GA4UserData & {
      manual_order_id: string;
      manual_order_reference: string;
      page_location: string;
      page_title: string;
      db_event_id: string;
    };
  }[];
};

Add To Cart

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

Payload Sent
export type GA4AddToCartPayload = {
  client_id: string;
  events: {
    name: 'add_to_cart';
    params: GA4UserData & {
      value: number;
      currency: GenericModels.CurrencyCodes.CurrencyCode['code'];
      items: {
        item_id: string;
        item_brand: string;
        item_name: string;
        item_variant: string;
        item_category: string;
        item_list_name: string;
        coupon?: string;
        discount?: number;
        index: number;
        price: number;
        quantity: number;
      }[];
      page_location: string;
      page_title: string;
      db_event_id: string;
    };
  }[];
};

Remove From Cart

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

Payload Sent
export type GA4RemoveFromCartPayload = {
  client_id: string;
  events: {
    name: 'remove_from_cart';
    params: GA4UserData & {
      value: number;
      currency: GenericModels.CurrencyCodes.CurrencyCode['code'];
      items: {
        item_id: string;
        item_brand: string;
        item_name: string;
        item_variant: string;
        item_category: string;
        item_list_name: string;
        coupon?: string;
        discount?: number;
        index: number;
        price: number;
        quantity: number;
      }[];
      page_location: string;
      page_title: string;
      db_event_id: string;
    };
  }[];
};

Begin Checkout

Tracks when the customer begins to checkout with their cart.

Payload Sent
export type GA4BeginCheckoutPayload = {
  client_id: string;
  events: {
    name: 'begin_checkout';
    params: GA4UserData & {
      value: number;
      currency: GenericModels.CurrencyCodes.CurrencyCode['code'];
      transaction_id: string;
      items: {
        item_id: string;
        item_brand: string;
        item_name: string;
        item_variant: string;
        item_category: string;
        item_list_name: string;
        coupon?: string;
        discount?: number;
        index: number;
        price: number;
        quantity: number;
      }[];
      page_location: string;
      page_title: string;
      db_event_id: string;
    };
  }[];
};

Complete Purchase

Tracks when a customer completes checkout successfully.

Payload Sent
export type GA4CompletePurchasePayload = {
  client_id: string;
  events: {
    name: 'purchase';
    params: GA4UserData & {
      value: number;
      currency: GenericModels.CurrencyCodes.CurrencyCode['code'];
      transaction_id: string;
      items: {
        item_id: string;
        item_brand: string;
        item_name: string;
        item_variant: string;
        item_category: string;
        item_list_name: string;
        coupon?: string;
        discount?: number;
        index: number;
        price: number;
        quantity: number;
      }[];
      page_location: string;
      page_title: string;
      db_event_id: string;
    };
  }[];
};

Last updated