Google Analytics Event Tracking Plugin for JQuery

Google Analytics Event Tracking Plugin for JQuery

·

1 min read

GAEvent is a small plugin (<600B minified & compressed) that enables event tracking in Google Analytics (by ga.js or the newer Universal Analytics)

GAEvent uses jQuery, so the syntax to start tracking is very simple:

$('.yourElements').gaEvent();

If you want to customize the data sent to Google, just add the options like so:

$('.yourElements').gaEvent({
  action: 'tap',
  category: 'Google Analytics Event Tracking Category',
  label: 'Custom Label',
  value: 1.25
});

Check out this repo for more clarity:

Google Analytics Event Tracking