Last active
February 7, 2018 17:57
-
-
Save gregberns/b1daa4718a10fefceb4eb5075829a2fd to your computer and use it in GitHub Desktop.
Optimizely - Remove Listener
This file contains hidden or 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
var token = Number(new Date()); | |
window["optimizely"] = window["optimizely"] || []; | |
window["optimizely"].push({ | |
type: "addListener", | |
filter: { | |
type: "lifecycle", | |
name: "pageDeactivated" | |
}, | |
token: token, | |
// Add the pageActivated function as a handler. | |
handler: function(data) { | |
//remove the listener | |
window["optimizely"].push({type: 'removeListener', token: token}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment