Skip to main content

Track Jebbit Events in Google Analytics 4 with Google Tag Manager (GTM)

Updated over a month ago

When Google Tag Manager (GTM) is implemented on the parent page where your Jebbit experience is embedded, you can leverage it to seamlessly track Jebbit events in Google Analytics 4 (GA4). This method allows you to capture detailed user interactions within your Jebbit experience and integrate them into your broader website analytics within GA4.

This article will walk you through the necessary steps to configure GTM for accurate GA4 event tracking of your Jebbit activities.

Before continuing, make sure:

  1. Google Tag Manager (GTM) is implemented on the parent page.

How it works

Jebbit sends the following events via postMessage along with the parameters jebbit_campaign_id and jebbit_source (which is always set to true):

  • jebbit_redirect

  • page_view

  • completion_node

  • custom_event

  • generate_lead

  • add_to_cart

These events are automatically pushed to the dataLayer for tracking.

Example data layer event:

dataLayer.push({
event: 'jebbit_redirect',
jebbit_campaign_id: 'YOUR_CAMPAIGN_PUBLIC_ID',
jebbit_source: 'true'
});

Step-by-step guide

1. Create data layer variables in GTM

To capture the custom parameters in GA4 events, you first need to create two data layer variables in GTM for jebbit_campaign_id and jebbit_source.

  1. Go to Variables > New.

  2. Give your variable a name.

  3. For the variable type, choose Data Layer Variable.

  4. In the data layer variable name, type jebbit_campaign_id.

  5. Save the variable.

  6. Repeat the process to create a new variable.

  7. In the data layer variable name, type jebbit_source.

  8. Save the variable.

2. Create custom event triggers in GTM

After your variables have been created, you need to configure GTM triggers to listen for each of the custom events that your application sends.

  1. Go to Triggers > New.

  2. Give your trigger a name.

  3. Navigate to Trigger Configuration.

  4. Select Custom Event.

  5. Under event name, type the name of the event from the dataLayer (e.g., jebbit_redirect).

  6. Save the trigger.

  7. Repeat these steps for each event you plan to capture. For example:

    • CE - Jebbit Redirect

    • CE - Page View

    • CE - Completion Node

    • CE - Custom Event

    • CE - Generate Lead

    • CE - Add to Cart

3. Create event tags in GTM

Finally, you will create GA4 event tags in GTM.

  1. Go to Tags > New.

  2. Give your tag a name.

  3. Navigate to Tag Configuration.

  4. For the tag type, choose Google Analytics: GA4 Event.

  5. (Optional) If your Google Analytics 4 Measurement ID does not auto-populate, copy and paste it.

  6. For the event name, type the name of the event from the dataLayer (e.g., jebbit_redirect).

  7. Under Event Parameters:

    1. Set the Event Settings Variable to "None."

    2. Add the data layer variables created in step one as event parameters.

  8. Navigate to the Triggering section and select the trigger you created above.

  9. Save the tag.

  10. Repeat these steps for each event you plan to capture. For example:

    • CE - Jebbit Redirect

    • CE - Page View

    • CE - Completion Node

    • CE - Custom Event

    • CE - Generate Lead

    • CE - Add to Cart

Did this answer your question?