Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save robisatthefunction/afc8a02a65cdf20126bb8974bf266e8a to your computer and use it in GitHub Desktop.
Save robisatthefunction/afc8a02a65cdf20126bb8974bf266e8a to your computer and use it in GitHub Desktop.
window["optimizely"].push({
"type": "addListener",
"filter": {
"type": "lifecycle",
"name": "initialized"
},
"handler": function(event) {
var utils = window.optimizely.get('utils');
utils.waitUntil(function(){
return typeof(window.optimizely.get('visitor').first_session) == "boolean";
}).then(function(){
window.optimizely = window.optimizely || [];
window.optimizely.push({
"type": "user",
"attributes": {
"New Visitor": window.optimizely.get('visitor').first_session
}
});
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment