Google Analytics (UA)

You can link Google Analytics (universal analytics) with AB Tasty to be able to analyze your campaigns outside the AB Tasty reporting. Your campaign data will be sent directly to GA as events or dimensions.

How to Set up the Integration

  1. Access Integrations > Integration Hub.
  2. Search for and select Google Analytics (UA).
  3. Click Setup connector.
  4. Give a name to your connector so you can easily retrieve it.
  5. Configure the following fields:
    1. Implementation
    2. Custom index
    3. Tracker name
    4. Function name
  6. Click Save and create connector.

Filling in the Fields

To find the required information and verify that data is correctly sent to Google Analytics, you will need the GA Debugger add-on.

Implementation

Select which GA tag you are using:

  • Analytics.js: the old version of the Google tag
  • Gtag.js: the new Google tag

Custom Index

AB Tasty can send data to GA through events or custom dimensions. To use a custom dimension, you must create it in GA beforehand and then enter the corresponding number in the Custom Index n° field.

Heads up
If you use a custom dimension at the account level, and if several campaigns are running at once, data from all live campaigns will be linked to the same custom index and will be overwritten. Therefore, we recommend using the custom index at the campaign level or not utilizing it at all.

Tracker Name

The tracker name can be viewed as a username that GA gives to the data so that it can be retrieved later. This is the most important field as the integration is based on this variable.

To retrieve the tracker name, follow the steps below:

  1. Access your website and turn the GA Debugger add-on ON.
  2. Right-click the page and inspect it.
  3. Access the Console tab: you should see data and information about Google Analytics.
  4. Search for “new tracker” (with[CMD+F] on Mac or[CTRL+F] on Windows):

Integration_Guide_Analytics_Tools_02.png

Here, the tracker name is “gtm4”. Depending on how Google Analytics has been configured, you will see different results. If you see something different from “gtmXX”, you can copy the tracker name in the dedicated field in AB Tasty. If not, there are some extra steps. 

If the tracker name you see in the console starts with “gtm”, this means that your GA account is managed via Google Tag Manager. In this case, the tracker name is random and Google can modify it at any time. You can either keep it as is, with the risk that the integration no longer works in a few weeks or months, or fix the tracker name in GTM directly.

To do so, in GTM, access Universal Tag and edit the tag configuration.

Integration_Guide_Analytics_Tools_03.pngIntegration_Guide_Analytics_Tools_04.png

  1. Look for the tracker type = page view. Select Enable priority settings.
  2. Add the tracking ID (= GA account ID (example: UA-12345678-1).
    Integration_Guide_Analytics_Tools_05.png
  3. Click More settings > Advanced configuration > Set tracker name = True.
    Integration_Guide_Analytics_Tools_06.pngIntegration_Guide_Analytics_Tools_07.png
  4. Define the tracker name. Identify it in any way you want, and copy it in AB Tasty settings (avoid special characters and spaces).

Heads up
If you leave the original GTM tracker, it may be modified over time and the link may no longer work.

Function Name

To retrieve the function name, access the console and search for “running command”: The function name is the word before the parenthesis: Running command: function name(“create”,…).

Integration_Guide_Analytics_Tools_08.png
Most of the time, the function is called "GA".

Verifying That AB Tasty Data Is Correctly Sent to GA

Once you have filled in all the required fields (at the account or the campaign level), you will need to verify that the data is correctly sent to GA.  

Heads up
You must update the AB Tasty tag to make your changes live.

To QA the integration, you must be affected by a campaign where the integration has been configured. 

The GA Debugger add-on will help you verify that data is correctly sent to Google Analytics. 

  1. Turn the GA Debugger add-on ON.
  2. Open the console.
  3. Search for “AB Tasty” (with [CTRL+F] on Windows or [CMD+F] on Mac). 

If you see Sent beacon below the running command and the event Category (&ec) line set to AB Tasty (like in the screenshot below), this means that data is correctly sent to GA and you should see events coming through GA’s real-time dashboard.

Integration_Guide_Analytics_Tools_09.png
If you see Command ignored. Unknown target: undefined below the running command, this means that the integration was not carried out correctly.

Integration_Guide_Analytics_Tools_10.png
Be careful to check the running command for the campaign in which the integration has been configured. In the screenshot above, we can see that this command matches test ID615868. Search for the other results if it is not the right campaign.

If the command is ignored in the console for the running command, it may be due to one of the following reasons:

  • You are not affected by the campaign
    Check that you are affected by the campaign by using the QA Assistant or the ABTasty.results command in the console
  • The tag was not refreshed after the fields were configured
    Check that the tag is up-to-date. If this isn’t the case, click the “Tag” button in the header:

  • The tracker name is incorrect
    Most of the time, this explains why data is not sent to GA. In this case, try with another tracker name (if any) via the GA Debugger add-on. Repeat the steps mentioned in this guide.
    Copy and paste the newly created tracker name in AB Tasty, refresh the tag and test the integration again.
    Repeat the process with all tracker names until data is sent.

How Is AB Tasty Data Displayed?

AB Tasty’s data are displayed in Google Analytics in two ways: via events or custom dimensions.

Events

When you link AB Tasty and Google Analytics third-party tools, AB Tasty sends an event to Google Analytics with the following naming template:

  • Category: AB Tasty
  • Action: [Test ID] Test name
  • Label: [Variant ID] Variant name

⭐ You can add it as a second dimension in existing reports

If you want to compare the two versions, simply select the Event label as a second dimension. If needed, you can make a filter (in the top right) to show a specific variant.

Integration_Guide_Analytics_Tools_12.png

⭐ You can create a custom report

Integration_Guide_Analytics_Tools_15.gif
Integration_Guide_Analytics_Tools_14.png
Here, we have crossed the event with page views, but you can choose the metrics you need.

⭐You can add a segment

A segment allows you to compare the two versions of your test with all data in your Google 

Analytics interface:

Configuring the segmentIntegration_Guide_Analytics_Tools_15__1_.gif
Comparing the data directly in Google Analytics reports

Custom Dimensions

Integration_Guide_Analytics_Tools_16__1_.png

When you link your tools, you assign a custom dimension ID to your test.

Good to Know 💡

You must create the custom dimension in Google Analytics before adding it to AB Tasty. The index that you will need to fill in will be assigned by Google Analytics.

You must enter the following items:

The name (usually “AB Tasty” but you’re free to choose another if you like)

The scope (usually “user”), as tests apply to users. This determines which field of application will be assigned to your variable.

There are 4 fields of application: product, hit, session, and user.

  • Product: the value is applied to the product for which it was defined.
  • Hit: the value applies to the specific call for which it was defined.
  • Session: the value applies to all the calls in a single session.
  • User: the value is applied to all calls in the current and future sessions until changes in value or custom dimensions are deactivated.

The value of this custom dimension is constructed as follows:

[Test ID] Test name—[Variant ID] Variant name

You can then use it exactly like an event. Simply select the AB Tasty custom dimension (if this is how you named it) instead of the event title.

Was this article helpful?

/