Last active
May 10, 2017 15:33
-
-
Save tomfuertes/d6d48c6b26cf3ab86804 to your computer and use it in GitHub Desktop.
link and log exp's
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var $ = optimizely.$; | |
$.each(optimizely.allExperiments, function(id, experiment) { | |
var data = { | |
name: experiment.name | |
}; | |
if (experiment.enabled) data['enabled'] = true; | |
console.group(data); | |
if (experiment.variation_ids) $.each( | |
experiment.variation_ids, | |
function(idx, variation) { | |
var data = { | |
v: optimizely.allVariations[variation].name | |
}; | |
if (optimizely.variationMap[id] === idx) data.on = true; | |
console.log([ | |
location.protocol, '//', location.hostname, | |
location.pathname, location.search ? location.search + '&' : '?', | |
'optimizely_x', id, '=', idx, location.hash | |
].join(''), data); | |
}); | |
console.groupEnd(); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment