A/B Testing

General testing

Engage provides the means of tracking any variation to a page or store and present key metrics and statistical analysis of the variations to these metrics in a conducted test. In general, the user is required to setup their split test by controlling when to show the various variations of the content being tested. To track the variations in Engage, we require the following code snippet to be added to each variation, with a unique variant id.
1
<body>
2
...
3
zlt.track('Variant', {"id":"variant-name", "test_id":"ab test name"})
4
...
5
</body>
Copied!
That's it! adding this snippet allow us to track the variant being displayed and you can use the variants as dimensions in any report. Among other, the following metrics are available:
  • Bounce rate
  • pages per visit
  • Conversion rate
  • Cart abandonment rate
  • add-to-cart-rate
  • Unique visitors
  • time on site
  • returning visitors
  • Average order value
  • Revenue
  • Revenue Per Visitor
  • returning customers
  • return on ad spend

A/B testing with Google Analytics

Engage can set a
1stparty1^{st} party
variant cookie that can be picked up by Google Analytics to analyse the test outcome further. Note that this cookie cannot be made sticky when Engage isn't determining which content to display. Hence, it is recommended to split traffic on browsing session when using Engage and Google Analytics this way to ensure valid test results.
Add the following code snippet to activate the cookies.
1
<body>
2
...
3
zlt.track('Variant', {
4
"test_id":"ab test name",
5
"id":"variant-name",
6
"set_cookie":true
7
})
8
...
9
</body>
Copied!

Step 2: Setup GTM

In GTM, create a
1stparty1^{st} party
cookie User-Defined Variable that reads the value from zlt_variant_testing.
  1. 1.
    In the GTM Workspace, click on Variables, then new in the User-Defined Variable section
  2. 2.
    Then select
    1stparty1^{st} party
    cookie and set cookie name to zlt_variant_testing
  3. 3.
    Save as zlt variant (you may set any name, but remember it for the next step)

Step 3

Head over to Tags to assign it to the Google Analytics page view tag. Create a new, or edit an existing tag according to below. Define your Google Analytics settings and your tracking ID. Then add zlt variant as a custom dimension.
All set! Now you can measure the result from your A/B test in Google Analytics

Testing product recommendations

A/B testing of product recommendations is crucial to determine the best performing model. Engage provides A/B testing out-of-the-box and it is very easy to setup.
1
<div class="zlt" data-id="clustered-similarity,similarity" data-key="[KEY]"></div>
Copied!

Constraints

  • Due to the nature of A/B testing it is not possible to run more than one test simultaneously
  • A/B test of product recommendations split visitors in 50/50 by default
Last modified 8mo ago