Send Events to GA4 via DataLayer
Overview
Following the steps in this article, you'll use the DataLayer integration available in your Explore account to send experiment-related events into your GA4 property whenever visitors browse pages affected by your experiments.
This guide assumes you already have some knowledge of web analytics tracking, and that you've already created and installed a Google Tag Manager (GTM) web container on your website that sends data to your GA4 property.
If you perform the steps below while also having the Google Analytics Integration active in your Explore Integrations section, you'll effectively double your GA4 events - once via the Explore Integration and once via the dataLayer/GTM integration - affecting data quality and your analysis.
Step 1 - Activate the DataLayer integration in Explore
-
Select your website from your Explore account, then click Integrations from the dropdown menu.
-
Scroll to the Google Tag Manager section and input exactly
dataLayerinto the Data Layer variable name field.
-
Click Enable to activate the integration.
Once enabled, you'll start receiving Omniconvert events in your website's dataLayer whenever a visitor sees a variation of an Explore experiment.
Every Omniconvert event has an Event Name of Omniconvert, and includes two variables:
-
mktzExperiment:[ExperimentID]Experiment Name -
mktzVariation:[VariationID]Variation Name
We'll now use Google Tag Manager's ability to create and customize GA4 events to send this data to your GA4 property.
Step 2 - Creating the tag
-
From your GTM workspace, go to Tags.
-
Click New.
-
Click Tag Configuration.
-
Select Google Analytics from the Featured section.
-
Select Google Analytics: GA4 Event as the tag type.
-
Name the tag
GA4 - omniconvert.

If you already have another GA4 tag in GTM, copy the GA4 Measurement ID from it into this new tag.
Obtaining the Measurement ID (if you don't have another GA4 tag)
-
Go to your Google Analytics account.
-
Open Admin via the cog icon in the bottom right.
-
Under Data collection and modification, click Data streams.
-
Click your web data stream.

-
Copy the GA4 Measurement ID and paste it into the
GA4 - omniconverttag's Measurement ID field.

Set the Event Name to omniconvert - this is the unique event you'll see in GA4 after publishing the tag.
Step 3 - Defining the experiment variables
-
Expand Event Parameters and add two empty parameters.
-
Define the first as
exp_name, holding the value of themktzExperimentdataLayer variable. -
Define the second as
exp_var, holding the value of themktzVariationdataLayer variable.

To create each dataLayer variable: type #{{ in the Event Parameter Value box, scroll to the bottom of the dropdown, and select New Variable (or click the Event Parameter Value button and the + symbol in the variable list).

-
Choose the Data Layer Variable type.
-
Give it a descriptive name, e.g.
dl - experiment name. -
Input exactly
mktzExperimentas the Data Layer Variable Name and click Save.
-
Repeat for the second variable: name it
dl - experiment variation, and input exactlymktzVariationas the Data Layer Variable Name.
At this stage, the tag should show both parameters configured:

Step 4 - Creating a trigger
-
Click Triggering below the tag, then the
+symbol, then Trigger Configuration. -
Select Custom Event as the trigger type.
-
Name the trigger
event - omniconvert, and input exactlyOmniconvertinto the Event Name field.
-
Click Save.
Defining custom dimensions in GA4
For exp_name and exp_var to be recognized in GA4, define them as custom dimensions first:
-
Go to your Google Analytics account.
-
Open Admin via the cog icon.
-
Under Data Display, click Custom Definitions.
-
Click Create custom dimension.

-
Input exactly
exp_namein both the Dimension name and Event parameter fields, set Scope to Event, and click Save.
-
Repeat for
exp_var.
The end result should show both custom dimensions listed:

Once both custom dimensions are defined, verify and publish your GTM container changes - add a Version Name and Description for easier tracking, then click Publish.

Data only collects when visitors interact with a page affected by an active Explore experiment, triggering the GA4 - omniconvert tag via the active GTM integration. Allow up to 24 hours for event data to populate in GA4 after publishing, or from the first triggered event.
Step 5 - Visualizing the data
We recommend using GA4's Exploration reports for custom visualization. For more advanced needs, tools like Looker Studio can import GA4 data directly.
Building an Exploration report
-
Go to the Explore section of your GA4 property.
-
Create a Blank exploration report and name it (e.g.
Omniconvert events).
-
Click
+next to DIMENSIONS, searchevent, and select Event name. -
Search
expand select bothexp_nameandexp_varcustom dimensions, then confirm.
-
Click
+next to METRICS, search and select Sessions, Total users, and Event count, then confirm.
-
Double-click each dimension and metric to add them to the Free form 1 report - dimensions go to Rows, metrics to Values automatically.

-
In the Settings pane, scroll to FILTERS, select the Event name dimension, set Condition to exactly matches, and input
omniconvert, then Apply.
-
Select different date ranges to see how many users, sessions, or
omniconvertevents were collected in that timeframe.