Skip to content

Instantly share code, notes, and snippets.

@davidjb
Last active March 9, 2016 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidjb/588da06e31c70518aafe to your computer and use it in GitHub Desktop.
Save davidjb/588da06e31c70518aafe to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$(".globalheader a").click(function() {
if($(this).attr('href').toLowerCase() != "javascript:;" && $(this).attr('href') != "#") {
ga('send', 'event', {
eventCategory: 'Global Header',
eventAction: 'open',
eventLabel: $(this).attr('href'),
transport: 'beacon'
});
}
});
// Other types go here
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment