Google Tag Manager + GA4

ABlyft includes built-in features for analyzing experiments at a goal-oriented level. If additional details are needed, it is possible to integrate ABlyft with Google Analytics 4 (GA4).
This integration can be accomplished through Google Tag Manager (GTM).

On this page

ABlyft GTM integration

The integration will trigger an event in the dataLayer whenever a visitor encounters or views an experiment. GA4 will receive this data and enable filtering options for analysis. ABlyft provides a native GTM integration (custom integrations are also an option).

  1. Access ABlyft by logging in.
  2. Navigate to the left-side menu and choose Integrations.
  3. Activate the GTM integration.

The dataLayer will now be available with the following information:

  • Project ID
  • Project name
  • Experiment ID
  • Experiment name
  • Variation ID
  • Variation name

Create variables (GTM)

Variables enable the saving of data from the dataLayer.

Workspace

To make sure nothing interferes with the project, create a new workspace first.

  1. Open GTM.
  2. Optionally, select Default Workspace, and click the + icon to create a new workspace.
    1. Name: ABlyft > GA4 connection
    2. Description: Using the dataLayer to send ABlyft events to GA4.

Variable 1 - Project ID

Move to Variables on the left-side menu.

Create and save New variable (1).

Name dlv - ABlyft - project_id
Variable Type Data Layer Variable
Data Layer Variable Name project_id
Data Layer Version Version 2

Variable 2 - Project name

Create and save New variable (2).

Name dlv - ABlyft - project_name
Variable Type Data Layer Variable
Data Layer Variable Name project_name
Data Layer Version Version 2

Variable 3 - Experiment ID

Create and save New variable (3).

Name dlv - ABlyft - experiment_id
Variable Type Data Layer Variable
Data Layer Variable Name experiment_id
Data Layer Version Version 2

Variable 4 - Experiment name

Create and save New variable (4).

Name dlv - ABlyft - experiment_name
Variable Type Data Layer Variable
Data Layer Variable Name experiment_name
Data Layer Version Version 2

Variable 5 - Variation ID

Create and save New variable (5).

Name dlv - ABlyft - variation_id
Variable Type Data Layer Variable
Data Layer Variable Name variation_id
Data Layer Version Version 2

Variable 6 - Variation name

Create and save New variable (6).

Name dlv - ABlyft - variation_name
Variable Type Data Layer Variable
Data Layer Variable Name variation_name
Data Layer Version Version 2

Create trigger (GTM)

To ensure Google Analytics recognizes a visitor's participation in an experiment, it's necessary to establish a trigger.

Access the **Triggers** page via the left-side menu.
Create and save a New trigger with the following details:

Name ABlyft GA4 trigger
Event name ablyft-viewed-experiment
This trigger activates on All Custom Events

Create GA4 Tag (GTM)

Create New tag.

Name ABlyft GA4
Tag type Google Analytics: GA4 event
Measurement ID Get the measurement ID from GA4.
The measurement ID might already be available via a variable if it was already configured.
Event name ablyft-viewed-experiment

Add Event Parameters:

project_id {{dlv - ABlyft - project_id}}
project_name {{dlv - ABlyft - project_name}}
experiment_id {{dlv - ABlyft - experiment_id}}
experiment_name {{dlv - ABlyft - experiment_name}}
variation_id {{dlv - ABlyft - variation_id}}
variation_name {{dlv - ABlyft - variation_name}}

Select trigger: ABlyft GA4 Trigger

Save

Validation

  1. Publish changes in GTM.
  2. Update default workspace in GTM.
  3. Launch GA 4.
  4. Access the appropriate property.
  5. Select Reports from the menu on the left.
  6. Proceed to the Real-time page.
  7. Observe the card titled Event count by Event name.
  8. Open a new incognito browser window and navigate to the page with the experiment.
  9. After a few minutes, revisit the Event count by Event name card in GA4.
  10. Verify if ablyft-viewed-experiment is present; if so, click on it.
  11. Additional events will be shown.

Please note It can take up to 48 hours before the data is available in other reports.

Learn how to access the ABlyft GA4 events to analyse experiments.