If you have implemented the GA tag on your site via Google Tag Manager, you need to set up the trigger, variables, and GA tag so that the GTM event can be correctly routed to Google Analytics.
INFO: When a visitor is served an experience, Qubit will send a single custom event to GA and, for tags implemented via Google Tag Manager, a single GTM event. These events are only sent once per session when the visitor is served the experience.
WARNING: These events are only sent for published experiences.
To get started, log in to your Google Tag Manager account.
We'll start by creating a trigger to detect when the GTM event is sent by Qubit.
Select Triggers from the side menu
Select New and enter a name for the trigger
Once you have created the trigger, you need to configure it by defining the event that will cause it to fire.
Select anywhere in the Trigger Configuration panel and scroll down and select Custom Event
Enter qubit.experience
in Event name and select Some Custom Events from This triggers fires on
Define the following trigger conditions: Event > equals > qubit.experience and select Save to finish
In this step, we will set up the variables that will be passed to the GA tag. You will need to create and configure a variable to pass the experience Id and a second variable to pass the experience variation Id.
Select Variables from the side menu
Select New to create a user-defined variable and enter Qubit Experiment Id
as the variable name
Select anywhere in the Variable Configuration panel, select Data Layer Variable as the variable type and enter qubitExperimentId
in Data Layer Variable Name
Select Version 2 from Data Layer Version combo box and select Save
Create and configure a second variable, repeating the steps above, and enter Qubit Variation Master Id
as the variable name and qubitVariationMasterId
as the Data Layer Variable Name
In this final step, we need to create and configure the GA tag that will fire when the trigger is activated.
Select Tags from the side menu
Select New and enter a name for the tag
Select anywhere in the Tag Configuration panel and select from the slideout menu
Select Event from Track Type and enter Qubit Experience
in Category. In Action, select and then Qubit Experiment Id from the slideout
In Label, select and then Qubit Variation Master Id from the slideout
In Value, select and then Qubit Variation Master Id from the slideout
Select True from Non-interaction Hit and select the variable that you use to store your tracking Id from Google Analytics Settings
TIP: If you don't know your tracking Id, see Find your tracking ID and tracking code snippet.
If you haven't already created a variable to store your tracking Id, you will need to do this. Select New Variable from Google Analytics Settings. Enter a name for your variable and enter your tracking Id in the field provided. You can leave the other fields in their default state.
Scroll down and select anywhere in the Triggering panel. Select the trigger you created earlier and select Save