Skip to content

Instantly share code, notes, and snippets.

@carlsednaoui
Created November 27, 2013 17:19
Show Gist options
  • Save carlsednaoui/7679496 to your computer and use it in GitHub Desktop.
Save carlsednaoui/7679496 to your computer and use it in GitHub Desktop.
(function getABTest() {
var abTestName = '',
abTestVariation = '',
abTest = 'No test',
abTestExperiments = optimizely.allExperiments[Object.keys(optimizely.variationMap)];
if (abTestExperiments) {
abTestVariation = Object.keys(optimizely.variationNamesMap).map(function(el) { return optimizely.variationNamesMap[el]; })[0];
abTestName = abTestExperiments.name;
abTest = abTestName + ': ' + abTestVariation;
}
return abTest;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment