Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(function(){
// @version 2016.03.11
var experimentID = COPY_PASTE_ID_FROM_URL;
window.optimizely = window.optimizely || [];
// avoid firing in editor
if (window.optimizely.activeExperiments.indexOf(experimentID.toString()) == -1) return;
if (typeof window.optimizely.data.experiments[experimentID] !== 'undefined') {
var experimentName = experimentID + ' ' + window.optimizely.data.experiments[experimentID].name;
var variationName = window.optimizely.data.state.variationNamesMap[experimentID];
// google analytics events
window.ga = window.ga || function() {(window.ga.q = window.ga.q || []).push(arguments);}; window.ga.l =+ new Date();
window.ga('send', 'event', 'Optimizely', experimentName, variationName, {'nonInteraction': 1});
// hotjar recordings tags
window.hj = window.hj || function() {(hj.q = hj.q || []).push(arguments)};
window.hj('tagRecording', [experimentName, variationName]);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.