All articles

A|B Split Test Beta script

2017-03-24 15:35:49 by Rolands,

When using our beta A|B testing tool, please use this code:

<script type="text/javascript">
var smcabkey = 'YOURABSPITTESTTAG';
var smcabdomain = '';
var simplemediacode_abtest = document.createElement('script');
var smcabstring = '//' + smcabdomain + '/' + smcabkey + '.js?rand=';
simplemediacode_abtest.src = smcabstring + Math.random();

where YOURABSPITTESTTAG replace with the provided key. Domain might be different (from client to client)

Use this code in your page's <head> section or via Google Tag Manager (GTM instructions below). From this moment campaign is ON! Congratulations!

Preview option

To preview changes use ab_preview URL parameter with value 1, like: ?ab_preview=1 or &ab_preview=1.


  1. or;
  2. or;

General availability

This code will change in future! This is public BETA.

Google Tag Manager instructions

  1. Login into GTM;
  2. Chose your domain (or add new) ;
  3. Under Tags from left side menu chose tag to edit (or create new);
  4. Paste your code (don't forget to change YOURABSPITTESTTAG parameter);
  5. Check "Support document.write";
  6. Under Tag firing options chose Unlimited;
  7. Under Triggering chose All pages -> Page views;
  8. ... and SAVE (top right corner)!


Don't forget to PUBLISH changes (top right corner);