Created
November 27, 2017 15:59
-
-
Save Nils-van-Kleef/dbc2eea069dd6adbe43753f2f51d5f7b to your computer and use it in GitHub Desktop.
Integration of Econda with Optimizely. Use in Custom Analytics Integrations (or Project JavaScript).
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
// Pre conditions : | |
// 1: Econda-Tracking-Script is loaded before | |
(function(){ | |
var decObject = window.optimizely.get("state").getDecisionObject({campaignId: campaignId}); | |
if( typeof window.emos3 !== 'undefined'){ | |
window.emos3.send({ type: 'event', abtest: [ [decObject.experiment , decObject.variation] ] }); | |
} else if (typeof(window.emosPropertiesEvent)== "function"){ | |
window.emosPropertiesEvent({ type: 'event', abtest: [ [decObject.experiment , decObject.variation] ] }); | |
} else { | |
console.log("Problem: econda A/B Test Tracking is activated but tracking library is not yet loaded. Could not send data to econda."); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment