Skip to content

Instantly share code, notes, and snippets.

@mdigital
Created June 26, 2012 20:18
Show Gist options
  • Save mdigital/2998640 to your computer and use it in GitHub Desktop.
Save mdigital/2998640 to your computer and use it in GitHub Desktop.
Google Analytics Outbound Link Tracking in CoffeeScript
$('a[href^="http"]').on 'click', (e) ->
e.preventDefault
_gaq.push(['_trackEvent', 'Outbound', 'click', this.href])
callback = -> window.location = arguments[0]
setTimeout callback, 200, this.href
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment