This guide outlines how to track user interactions within your Jebbit experiences using Google Analytics 4 (GA4) via Google Tag Manager (GTM). By implementing GTM on the parent page where your experience is embedded, you can capture detailed event data and integrate it into your broader website analytics within GA4.
Before you begin
Confirm you have set up a Google Analytics 4 integration
Events sent from Experiences by Jebbit
Experiences 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'
});
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
.
Go to Variables > New.
Give your variable a name.
For the variable type, choose Data Layer Variable.
In the data layer variable name, type
jebbit_campaign_id
.Save the variable.
Repeat the process to create a new variable.
In the data layer variable name, type
jebbit_source
.Save the variable.
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.
Go to Triggers > New.
Give your trigger a name.
Navigate to Trigger Configuration.
Select Custom Event.
Under event name, type the name of the event from the dataLayer (e.g.,
jebbit_redirect
).Save the trigger.
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
Create event tags in GTM
Finally, you will create GA4 event tags in GTM.
Go to Tags > New.
Give your tag a name.
Navigate to Tag Configuration.
For the tag type, choose Google Analytics: GA4 Event.
(Optional) If your Google Analytics 4 Measurement ID does not auto-populate, copy and paste it.
For the event name, type the name of the event from the dataLayer (e.g.,
jebbit_redirect
).Under Event Parameters:
Navigate to the Triggering section and select the trigger you created above.
Save the tag.
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
Next steps
Test your implementation to ensure that events are firing correctly.