Integrating FigPii With GA4 via Google Tag Manager
Info: Integrating your FigPii experiments with GA4 via GTM is a one-time setup. You don't need to repeat this procedure for every new FigPii experiment.
Google Analytics 4 (GA4) represents the newest iteration of Google Analytics. It is a departure from the conventional "Universal" Analytics as it primarily operates based on events.
One of the key benefits of GA4 is its versatility. It is adaptable for use with a standalone website, a mobile application, or a combination of both.
By synchronizing your FigPii account with GA4, you can create GA4 audiences directly from FigPii. You can activate this integration with a few simple steps.
ATTENTION: Before proceeding, you must first check the installation of the GA4 code present on your website. If it's installed directly on the website, please follow the article Integrating FigPii with Google Analytics 4 to set up your FigPii-GA4 integration. Use the integration method described in this article only when your GA4 code is installed via GTM on the website.
Integrating FigPii with GA4 via GTM
Pushing FigPii experiment variation to GA4 via GTM is a 4-step process:
- Creating Data Layer Variables in GTM
These variables are used to create tags and define triggers for events to execute. - Creating Triggers For The Integration Events
The firing rules are conditions that evaluate to either fire or not fire an event to the tags. These allow FigPii to push test data to GTM.
- Creating the Integration Tag in GTM
Tags are code snippets that finally push the data captured by the variables and fired by the triggers to your analytics tool, such as Google Analytics.
- Enabling GA4 Integration in FigPii
Once you’ve configured GTM, the next step is to enable GA4 integration in FigPii.
Creating Data Layer Variables in GTM
The first step of FigPii GA4 integration is to create data layer variables. You must log in to your GTM account and create the following two data layer variables with the default value of 0:
FigPii Experiment Variant String
This data layer variable is used to send the FigPii experiment and its corresponding variation values to GA4. The format of this variable value will be "FIG-{experimentId}-{variationId}". To define this variable, perform the following:
- In the Title field, enter FigPii Experiment Variant String.
- In the Data Layer Variable Name field, enter figpii_exp_variant_string.
- From the Data Layer Version dropdown, choose Version 2.
- Enable the Set Default Value field, and in the Default Value field, enter the value 0 (zero).
- Click Save.
FigPii Unique Visitor ID
This data layer variable is used to send the FigPii Unique Visitor ID of the visitors to GA4, which can be later used to cross-check conversions and visitors between FigPii and GA4, perform the following:
- In the Title field, enter FigPii Unique Visitor ID.
- In the Data Layer Variable Name field, enter figpii_visitor_id.
- From the Data Layer Version dropdown, choose Version 2.
- Enable the Set Default Value field, and in the Default Value field, enter the value 0 (zero).
- Click Save.
Creating Triggers For the Integration Events
FigPii GA4 Experiment Variant Trigger
- In the Trigger Name field, enter FigPii GA4 Experiment Variant Trigger.
- Click on the Trigger Configuration tile, and select Custom Event under Other.
- In the Event Name field, enter figpii-data-push-ga4.
Notice: The event name must always be figpii-data-push-ga4. This event is stored in FigPii libraries and pushed when the GA4 integration is enabled for your domain.
- Click Save.
FigPii GA4 Unique Visitor ID Trigger
- In the Trigger Name field, enter FigPii GA4 Unique Visitor ID Trigger.
- Click on the Trigger Configuration tile, and select Custom Event under Other.
- In the Event Name field, enter figpii-id-push-ga4.
Notice: The event name must always be figpii-id-push-ga4. This event is stored in FigPii libraries and pushed when the GA4 integration is enabled for your domain.
- Click Save.
Creating the Integration Tag in GTM
Once you’ve created the triggers, the next step is to create the GTM tags. These tags are the code snippets that finally push the data captured by the variables and fired by the triggers to analyze your experiment data inside the analytics tools, such as Google Analytics 4. To complete the process, create the following tags in the GTM:
FigPii GA4 Experiment Variant Tag
To create the FigPii GA4 Experiment Variant Tag, perform the following steps:
- In the GTM dashboard, click Tags and select New.
- Click on the Tag Configuration tile, and then select Google Analytics: GA4 Event.
- In the Configuration Tag field, select your GA4 measurement ID.
- In the Event Name field, enter experience_impression.
Notice: The event name should always be experience_impression.
- Expand the Event Parameters section, click on Add Row, and in the ParameterName field, enter exp_variant_string, and in the Value field, enter {{FigPii Experiment Variant String}}.
- From the Triggering section, choose the Firing Triggers as FigPii GA4 Experiment Variant Trigger.
- Click Save.
FigPii GA4 Unique Visitor ID Tag
To create the FigPii GA4 Unique Visitor ID Tag, perform the following steps:
- In the GTM dashboard, click Tags and select New.
- Click on the Tag Configuration tile, and then select Google Analytics: GA4 Event.
- In the Configuration Tag field, select your GA4 measurement ID.
- In the Event Name field, enter FIGPII.
Notice: The event name should always be FIGPII.
- Expand the Event Parameters section, click on Add Row, and in the ParameterName field, enter figpii_visitor_id, and in the Value field, enter {{FigPii Unique Visitor ID}}.
- From the Triggering section, choose the Firing Triggers as FigPii GA4 Unique Visitor ID Trigger.
- Click Save.
Enabling GA4 Integration in FigPii
Follow this guide to enable GA4 integration for your domain: