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:

  1. Creating Data Layer Variables in GTM

    These variables are used to create tags and define triggers for events to execute.
  2. 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.
  3. 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.
  4. 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:

  1. In the Title field, enter FigPii Experiment Variant String.
  2. In the Data Layer Variable Name field, enter figpii_exp_variant_string.
  3. From the Data Layer Version dropdown, choose Version 2.
  4. Enable the Set Default Value field, and in the Default Value field, enter the value 0 (zero).
  5. 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:

  1. In the Title field, enter FigPii Unique Visitor ID.
  2. In the Data Layer Variable Name field, enter figpii_visitor_id.
  3. From the Data Layer Version dropdown, choose Version 2.
  4. Enable the Set Default Value field, and in the Default Value field, enter the value 0 (zero).
  5. Click Save.

Creating Triggers For the Integration Events

FigPii GA4 Experiment Variant Trigger

Create a trigger for the FigPii Experiment Variant String data layer variable by configuring the following fields:
  1. In the Trigger Name field, enter FigPii GA4 Experiment Variant Trigger.
  2. Click on the Trigger Configuration tile, and select Custom Event under Other.
  3. 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.
  1. Click Save.

FigPii GA4 Unique Visitor ID Trigger

Create a trigger for the FigPii Experiment Variant String data layer variable by configuring the following fields:
  1. In the Trigger Name field, enter FigPii GA4 Unique Visitor ID Trigger.
  2. Click on the Trigger Configuration tile, and select Custom Event under Other.
  3. 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.
  1. 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:

  1. In the GTM dashboard, click Tags and select New.
  2. Click on the Tag Configuration tile, and then select Google Analytics: GA4 Event.
  3. In the Configuration Tag field, select your GA4 measurement ID.
  4. In the Event Name fieldenter experience_impression.
Notice:  The event name should always be experience_impression.
  1. 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}}.

  1. From the Triggering section, choose the Firing Triggers as FigPii GA4 Experiment Variant Trigger.

  1. Click Save.

FigPii GA4 Unique Visitor ID Tag

To create the  FigPii GA4 Unique Visitor ID Tag, perform the following steps:

  1. In the GTM dashboard, click Tags and select New.
  2. Click on the Tag Configuration tile, and then select Google Analytics: GA4 Event.
  3. In the Configuration Tag field, select your GA4 measurement ID.
  4. In the Event Name fieldenter FIGPII.
Notice:  The event name should always be FIGPII.
  1. 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}}.

  1. From the Triggering section, choose the Firing Triggers as FigPii GA4 Unique Visitor ID Trigger.

  1. Click Save.

Enabling GA4 Integration in FigPii

Follow this guide to enable GA4 integration for your domain: 

Still need help? Contact Us Contact Us