Even better, use unobtrusive js to do that: $('your element').click(function(){//put calls to mixpanel here; return true; });
Re:Hacker Monthly #1 is here
by bearwithclaws on Tuesday June 01, 2010 @10:49PM
(#1396870)
Thanks for all the suggestions. I've implemented it:
$("a.magcloud").click(function() {
mpmetrics.track('purchase', {'issue': '#1'});
self.delay(500);
return true;
});
<a href="URL_TO_PDF" onclick="registerConversion()">Download</a>
You can put a minor 500 ms pause so that event gets registered.