You are on page 1of 3

Tracking A/B test views in GA

To determine if conversions happen AFTER the experiment was seen and thus have proper segmentation, we should send a variant view event
from the testing tool (e.g. Optimize).

Add impression events

Each experiment should include impression events, that can be added via Optimize JS code once that is loaded in the browser.

It can be a simple dataLayer push event, like:

window.dataLayer = window.dataLayer || [];


dataLayer.push({
"event": "GAevent",
"eventCategory": "AB tests",
"eventAction": "<ticket number> - <experiment name>",
"eventLabel": "<ticket number>-AB; G:'<group>'; A:'View';",
"eventNonInteraction": 1
});

<ticket number> - Replace with A/B test ticket ID.


<experiment name> - Experiment name in freeform.
<group> - Group that is displayed - CONTROL or VARIANT

If an experiment has additional events besides views (e.g. element Clicks) that you want to track, then you can replace A:'Impression' wi
th e.g. A:'Clicks' and keep the same naming for action and category.

Example:
Ticket number - SW-999; Experiment name - Filter UX update experiment
View tracking (CONTROL): Click tracking (CONTROL):

Category: "AB tests" Category: "AB tests"


Action: "SW-999 - Filter UX Action: "SW-999 - Filter UX
test" test"
Label: "SW-999-AB; Label: "SW-999-AB;
G:'CONTROL'; A:'View'" G:'CONTROL'; A:'Filter click'"
Non interaction: True Non interaction: False

Don’t forget to add an appropriate tag in GTM to collect this data. You can read more details on Custom event framework for GTM .

How to add dataLayer push in Optimize experiment source code


Creating a segment after tagging

After all tracking tags were added, create segments based on this event name to track conversion volumes in GA.
You should use Sequence segments and structure it in the following way:

1. Sequence Step 1 Experiment group view event


2. Sequence Step 2 Experiment group KPI event
3. Additionally, add your segment filters under “Conditions“ (E.g. device category)

A good approach for naming the segments in GA would be:


<Ticket name> - <Experiment name> - <Group and segment names>
Example 1: “CRVR-111 - presenter filter A/B test - Control - Views - Desktop”
Example 2: “CRVR-111 - presenter filter A/B test - Control - Conversions - Desktop”
Example 3: “CRVR-111 - presenter filter A/B test - Variant - Used filter - Mobile”

Segment configuration example (Experiment views):


And additional non-sequence based conditions can be added in the “Conditions“ section. E.g. Device category.

Session count in this segment can now be used as a “Conversion“ count for manual calculations.

You might also like