Skip to content

Instantly share code, notes, and snippets.

@mjallday
Created May 12, 2011 06:24
Show Gist options
  • Save mjallday/968039 to your computer and use it in GitHub Desktop.
Save mjallday/968039 to your computer and use it in GitHub Desktop.
Outbound link tracking in Google Analytics
<script type="text/javascript">
var ticketLink = 'http://tickets.kpop.sg';
$( function () {
$('a[href*="' + ticketLink + '"]').click ( function () {
_gat._getTrackerByName()._trackEvent('Outbound links', ticketLink);
setTimeout(function() { document.location = ticketLink; }, 100);
return false;
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment