Skip to content

Instantly share code, notes, and snippets.

@kohiomobz
Last active October 7, 2015 19:03
Show Gist options
  • Save kohiomobz/e3a9324f91caba60719a to your computer and use it in GitHub Desktop.
Save kohiomobz/e3a9324f91caba60719a to your computer and use it in GitHub Desktop.
Mixpanel: Track Links Workaround
<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