Use GTM Data Layer to integrate Convert with GA

Understand GTM Data Layer 

The Data Layer is one of the key concepts in the world of Google Tag Manager (GTM). It ensures maximum flexibility, portability, and ease of implementation. 

A data layer is like a spreadsheet of information you want to capture about the pages and activities that your users are viewing and performing. You collect all of the information in a data layer and send it along to other tools like Google Analytics through Google Tag Manager.

Push Convert Data to GTM Data Layer

Convert Experiments fired on pages are pushed into the Google Tag Manager default dataLayer object for further processing inside GTM. Below are the 3 keys of the Convert object pushed to GTM dataLayer: 

  • "event" - has as value "convert-trigger-experiment-{experiment_id}" where experiment_id is the ID of the fired experiment inside Convert Experiences app;
  • "experiment_id" - has as value the experiment id of the fired experiment inside Convert Experiences app;
  • "variation_name" - has the value variation name of the selected variation, as found inside Convert Experiences app

Example: 

dataLayer.push({ "event":"convert-trigger-experiment-1234", "experiment_id":"1234", "variation_name":"test variation" });

If you use Google Chrome console and you have activated the Convert Debugger extension, this is how it looks like when Convert pushes data to GTM data layer:

Inside Google Tag Manager, this data can be used and sent forward to other services that are supported.

Use GTM Data Layer to send Convert data to GA

Let's analyze how we would send the variation triggered to Google Analytics through a Custom Dimension. To send data over to Google Analytics we will use a Custom Event.

Each time that you create an experiment you will have to assign it a Custom Dimension in GA. If you have not created it, you will need to do before launching the experiment. Also, you will need to update the table created in the following steps, which assign the respective Custom Dimension to the Experiment ID before you launch the experiment.

Create the Custom Dimension in GA

Go to Admin section and under property you will find Custom Dimensions:

Create a new Custom Dimension of User scope and remember the index value:

Create the Experiment ID Data Layer variable in GTM

The Experiment ID Data layer Variable will store the Convert experiment_id values and we will use it every time we need to call this value.

Open Google Tag Manager and go to variables:

Create a new User Defined variable:

Give it a descriptive name, assign the type Data Layer Variable and fill in experiment_id in the Data Layer Variable name: 

Create a Dimension Index Lookup Table in GTM

We use this Lookup Table to support multiple Convert experiments running, e.g. Convert experiment_id 10023753 maps to GA Custom Dimension with Index 3. If you have only one experiment just use one row in that Lookup Table.

Go to variables and create a new User Defined Variable. 

Give it a descriptive name and assign as type Lookup Table. Then on the next screen, you will need to make an entry for each experiment that you are running and the custom dimension index number where you want to push it. 

Every time you create an experiment, you will have to find out its experiment id, and assign it to an already created custom dimension, and update the table accordingly. 

Create the Variation Name Data Layer variable in GTM

The Variation Name Data layer Variable will store the Convert variation_name values and we will use it every time we need to call this value.

Go to variables and create a new User Defined variable:



Give it a descriptive name and assign as type the Data Layer Variable. Specify its Data Layer Variable name and hit Save:

Create a new GTM Tag

Go to tags and create a new tag:


Give it a descriptive name and select as Tag Type Universal Analytics and as Track Type Event. Fill in all relevant fields as presented below:



Select your GA account and add the Custom Dimension as it is shown below:


Select the triggering rule to fire the tag. Create a new trigger, give it a descriptive name, select Custom Event and fill in relevant fields as it is shown below:


Please note that this rule will fire the tag every time an experiment will be fired. 

Disable Integration on Convert settings

Important: if you send variations to Google Analytics through Google Tag Manager, you might want to disable automatic send of variations through the "on-page" Google Analytics tag in Convert Experiments app (if used):



Create a Custom Report in GA

  1. Go back to Google Analytics
  2. Go to "Customisation"
  3. Create a new "Custom Report"
  4. Select the relevant Custom Dimension as the drill down dimension
  5. Configure any filters 
  6. Save

Have more questions? Submit a request

Comments