Integrate ABlyftIntegrations
Google Tag Manager + GA4
Send the experiments and variations a visitor saw to Google Analytics 4 through Google Tag Manager.
With the Google Tag Manager (GTM) integration, ABlyft pushes an event to the data layer whenever a visitor sees an experiment. You forward this event to Google Analytics 4 (GA4) and can analyze experiments beyond ABlyft's own goal reporting.
Step 1: Enable the integration in ABlyft
- Open Integrations in the left menu.
- Turn on the GTM integration.
From now on, each time a visitor sees an experiment, the data layer receives an event ablyft-viewed-experiment with
the project, experiment and variation (ID and name).
Step 2: Create variables in GTM
Optionally create a separate workspace, for example ABlyft > GA4 connection. Create six Data Layer Variables (Data
Layer Version 2):
| GTM variable | Data layer variable |
|---|---|
dlv - ABlyft - project_id | project_id |
dlv - ABlyft - project_name | project_name |
dlv - ABlyft - experiment_id | experiment_id |
dlv - ABlyft - experiment_name | experiment_name |
dlv - ABlyft - variation_id | variation_id |
dlv - ABlyft - variation_name | variation_name |
Step 3: Create the trigger
- Name:
ABlyft GA4 trigger - Type: Custom event
- Event name:
ablyft-viewed-experiment - Fires on: All custom events
Step 4: Create the GA4 tag
- Name:
ABlyft GA4 - Type: GA4 event, with the measurement ID of your GA4 property
- Event name:
ablyft-viewed-experiment - Event parameters: map each of the six parameter names to its variable, for example
project_idto{{dlv - ABlyft - project_id}} - Trigger:
ABlyft GA4 trigger
Step 5: Check the setup
- Publish the GTM changes.
- In GA4, open Reports → Real-time and look at the event count by event name.
- Open a page with a running experiment in a private window.
- After a few minutes,
ablyft-viewed-experimentshould appear. Click it to see the parameters.
Data can take up to 48 hours to appear in other GA4 reports.