Last active
October 7, 2015 19:03
-
-
Save kohiomobz/e3a9324f91caba60719a to your computer and use it in GitHub Desktop.
Mixpanel: Track Links Workaround
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
<div id=“example-link”></div> | |
$(“#example-link”).click(function(event){ | |
var redirectFunction = callback($(this)); | |
event.preventDefault(); | |
mixpanel.track(“Link Clicked”); | |
setTimeout(redirectFunction, 300); | |
}); | |
function callback(val) { | |
return function() { | |
window.location = val.attr(‘href’); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment