Google Analytics (UA)
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
Access Integrations > Integration Hub.
Search for and select Google Analytics (UA).
Click Setup connector.
Give a name to your connector so you can easily retrieve it.
Configure the following fields:
Click Save and create connector.
Select which GA tag you are using:
Analytics.js: the old version of the Google tag
Gtag.js: the new Google tag
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.
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:
Access your website and turn the GA Debugger add-on ON.
Right-click the page and inspect it.
Access the Console tab: you should see data and information about Google Analytics.
Search for “new tracker” (with[CMD+F] on Mac or[CTRL+F] on Windows):
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.
Look for the tracker type = page view. Select Enable priority settings.
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.
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”,…).
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.
Turn the GA Debugger add-on ON.
Open the console.
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.
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.
AB Tasty’s data are displayed in Google Analytics in two ways: via events or custom dimensions.
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.
⭐ You can create a custom report
⭐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:
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.
To find the required information and verify that data is correctly sent to Google Analytics, you will need the .
Add the tracking ID (= GA account ID (example: UA-12345678-1).
Click More settings > Advanced configuration > Set tracker name = True.
Most of the time, the function is called "GA".
The will help you verify that data is correctly sent to Google Analytics.
If you see Command ignored. Unknown target: undefined below the running command, this means that the integration was not carried out correctly.
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.
Here, we have crossed the event with page views, but you can choose the metrics you need.
Configuring the segment Comparing the data directly in Google Analytics reports