Last active
August 29, 2015 13:56
-
-
Save davidji99/9336391 to your computer and use it in GitHub Desktop.
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
| window.myInterval = setInterval(function() { | |
| if ($("some-selector").length > 0) { //looks for a selector | |
| /* | |
| do something here | |
| or add/or in a custom event goal like below: | |
| */ | |
| window['optimizely'] = window['optimizely'] || []; | |
| $("someselector").bind("mousedown", function() {window.optimizely.push(["trackEvent", "eventName"]); | |
| }); | |
| clearInterval(window.myInterval); //after it's found, clear the interval | |
| } | |
| }, 50) //in milliseconds; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment