Last active
March 11, 2016 12:13
-
-
Save lkraav/2ac6f6aef6d3d0a2fb71 to your computer and use it in GitHub Desktop.
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(){ | |
// @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