Split Test Conversion Tracking with Optimizely and LuckyOrange

Posted on by

Running A/B split and multivariate testing in Optimizely is a really easy way to see how small or big changes increase the conversion rate of your website. Combing the power of Optimizely and heat mapping tools, you’ll be able to see the “path” users take convert, and how they interact with different variations of your page!

You can use the Javascript code below to get the name of the Optimizely experiment your site visitor is currently interacting with. Using the heat mapping software such LuckyOrange, you’ll be able to “see” how users interact with your variations.

Step One

Place the code below in a JavaScript file on your website

var experimentID = window['optimizely'].data.state.activeExperiments[0];
var variationIndex = window['optimizely'].data.state.variationMap[experimentID];
var variationName = window['optimizely'].data.state.variationNamesMap[experimentID];
var variationID = window['optimizely'].data.state.variationIdsMap[experimentID];
var experiment_name = window['optimizely'].data.experiments[experimentID].name;

if (optimizely_experiment_id === "optimizely_experiment_id_i_wanna_track"){
var _loq = window._loq || []; // ensure queue available

_loq.push(["tag_recording", window['optimizely'].data.experiments[experimentID].name +"-"+window['optimizely'].data.state.variationIdsMap[experimentID]]); // this will tag, won't star, and will append the tag
}

Step Two

Replace the string optimizely_experiment_id_i_wanna_track with the ID of the Optimizely experiment you wish to track

Step Three

Monitor LuckyOrange to see how your variations are performing!

A Github gist has been created so you can reference the code above or you want to make alterations.



%d bloggers like this: