Integrate Convert Experiences with Google Analytics (analytics.js or gtag.js)

This Article Will Help You:



Introduction

You can have your experiments' data and statistics sent from Convert Experiences inside Google Analytics (Universal or Global Site Tag) and this way you are able to build rich reports that can bring valuable insights about how specific experiments perform on certain segments of users. For example, you could see how are your variations performing in a certain browser, or how are they performing for visitors that are coming from Adwords.

 

Tips

Please follow below steps only if you are using Universal Analytics analytics.js or Global Site Tag gtag.js.

For integrating with Google Analytics 4 please read these instructions.

What is the difference between Classic Analytics, Universal Analytics, Global Site Tag and GA4?

Before we start with the integration, let's clarify the different versions of tracking codes in Google Analytics.

In November 2005 Google launched Google Analytics, known also as 'Classic Analytics'. The tracking code can be found by the name ga.js. From 2016 it is considered Legacy and most of the accounts have been migrated to Universal Analytics.

In October 2012 another new version of Google Analytics was announced, called 'Universal Analytics'. The tracking code can found by the name analytics.js. The key differences from the previous version were: cross-platform tracking, flexible tracking code to collect data from any device, and the introduction of custom dimensions and custom metrics. 

In October 2017 another new version of Google Analytics was announced, called 'Global Site Tag'. The tracking code can be found by the name gtag.js. Its purpose is to unify the tagging system to simplify implementation. 

Finally, in October 2020, Google Announced Google Analytics 4 properties GA4 (formerly Google Analytics App+Web) which allows marketers and app product managers to understand their users, site data, and acquisition tracks for apps (tracked through Firebase) and web properties in just one Google Analytics web property.

Add Tracking Codes (Convert + GA)

Make sure that both tracking codes (Convert + GA) are added on your website head section. Google Analytics tracking code should be placed after Convert Experiments code.

For Convert tracking code you can read these instructions.

For GA Universal Analytics (analytics.js) you can read these instructions and for Global Site Tag (gtag.js) you can read these instructions.

Any custom Google Analytics code could break the integration.

10

11

Create Custom Dimension in GA 

In Google Analytics you can create Custom Dimensions for your Universal Analytics (analytics.js) or your Global Site Tag (gtag.js) properties.

Go to Admin, select the Account that you are interested in and then select Property. Under Property select Custom Definitions and then Custom Dimensions:
12

Select the +New Custom Dimension:

13

Give a descriptive name to your Custom Dimension since that will be used inside your reports (preferably give the Convert experiment_id as name to find it easier). Select User for Scope and then hit Save.

(If you want to have more information on why we select User for Scope check the different values here: https://support.google.com/analytics/answer/2709828?hl=en).

14

Notice that in the table with Custom Dimensions, your new Custom Dimension is now listed and it has an Index value. 

15

Enable the Integration through Convert 

After setting up your A/B experience, go to Experiment Summary by editing the experiment. Once you are in the Experiment Summary, go to Experiment section and then select Add/Edit Integrations:

16

Integrate through the use of Google Analytics Custom Dimensions - this is the option needed if you are using the Google Analytics Universal tracking (analytics.js) or the Global Site Tag (gtag.js). 

The index attached to each Custom Dimension (from the previous step) should be the same as the index we use in Convert (e.g. if you want to use Experiment #10023753 Custom Dimension which has Index value 1, you should select Dimension 1 in Convert):

17

See Convert data in GA reports  

After setting up this integration, the test data will start appearing inside Google Analytics as follows. If you have Data Anonymization enabled, Variation IDs (instead of Variation names) will be sent to GA.
If you are using the Universal Analytics tracking method or the Global Site Tag method and therefore the Custom Dimensions, you can use the custom dimensions inside custom reports or inside segments (to filter standard reports).

Go to Customisation and then Custom Reports:

18

Create a new Custom Report, and for the Dimension Drilldowns option, select the Custom Dimension you created in the previous step:

19

Once the report has been created, you should wait until you see the variations and data coming in. Google says that there could be a 24-48 hours data processing latency.
20
But eventually it should look like this. Each variation of the Convert experiment that you use should have a corresponding row in the Custom Report:
21
Custom dimensions can also be used as secondary dimensions in standard reports so you can enjoy using the data in your usual reports.
22

Multiple Google Analytics Trackers

If you have multiple Google Analytics trackers, you can follow these steps to install them on your website. It will look like this:


(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-xxxxxxxxx-1', 'auto');
ga('create', 'UA-yyyyyyyyy-1', 'auto', 'clientTracker');
ga('clientTracker.send', 'pageview');
ga('send', 'pageview');

Once you have installed them, you can select inside Convert Experiences Project Configuration which tracker to use to send the Convert Data to. Simply fill in the "Google Analytics UA Property":

 

If you have one tracker and you fill the "Google Analytics UA Property" field, it will send the Convert data to that tracker as if it was not filled.

If you have more than one tracker and you do not fill the "Google Analytics UA Property" field, data will be sent in one of the Google Analytics trackers, the one that you have defined first in order in your page source.

Integrate with Google Data Studio

Once you integrate with Google Analytics, it is easy to see your Convert data to Google Data Studio as well. 

Once you connect your Google Analytics view to a Data Studio report, all of your custom dimensions and metrics should be listed by name under the 'Custom Variables or Columns' section of the dimension dropdown menu.

Data Studio will take the experiment's data you have in Google Analytics. So, your Convert experiment should come with an ID. From there, just pull the information you want to. 

23

The report will look like this:

24