Skip to content

Instantly share code, notes, and snippets.

@amitavroy
Created March 27, 2013 14:18
Show Gist options
  • Save amitavroy/5254500 to your computer and use it in GitHub Desktop.
Save amitavroy/5254500 to your computer and use it in GitHub Desktop.
This code shows how to add an event to a click or other user event.
$('.tab').click(function() {
$(this).show();
var eventCategory = jQuery(this).attr('data-category');
var eventAction = jQuery(this).attr('data-action');
var eventLabel = window.document.title;
_gaq.push(['_trackEvent', eventCategory, eventAction, eventLabel]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment