Google Analytics Tracker Plugin
This plugin provides a simple way to embed your web application with page view tracking and event tracking of Google Analytics.
First of all, you need to set your analytics account id in
You can also set a debug flag to print messages in browser console everytime a _gaq.push occur.
Put the following tag in the end of the pages you want to track:
To track a click event, you simply add a
ga-tracked class in the element, and declare the attributes
<a href="/about" class="ga-tracked" data-ga-category="home" data-ga-action="about" data-ga-label="label">About</a>
GoogleAnalyticsTracker.bindTrackEvent function, passing the selector to these new elements.
You can also call directly
GoogleAnalyticsTracker.trackEvent, that will make a push to Google Analytics with the values you passed:
GoogleAnalyticsTracker.trackEvent("category", "action", "label");