Last active
September 7, 2016 11:19
-
-
Save Nils-van-Kleef/ffd946f9d3b953a14ae340b3779eab04 to your computer and use it in GitHub Desktop.
JS that gets Google Universal Analytics custom dimension slots that are in use by active (running) experiments
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
/** | |
* JS that gets Google Universal Analytics custom dimension slots that are in use by active (running) experiments. | |
* Execute in console on website with correct Optimizely snippet | |
*/ | |
console.log("All Google Universal Analytics Custom Dimensions in use by active experiments:"); | |
for (var experiment in optimizely.allExperiments) { | |
if (optimizely.allExperiments[experiment].enabled == true) { | |
if (typeof optimizely.allExperiments[experiment].universal_analytics == 'object') { | |
console.log("Experiment: " + experiment + ". Custom Dimension used: " + optimizely.allExperiments[experiment].universal_analytics.slot); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment