By : Olivenbaum Published On Tuesday, May 24, 2011, 13:34 In JavaScript
This is a Google Analytics implementation for jQuery with advanced Event Tracking functionality.
Implementation is as easy as:
$('#element').ga('click', ['_trackEvent', 'Click', '#element']);
That’s it!
You also don’t have to worry that Google Analytics is fully loaded because this plugin maintains its own queue and executes all Analytics commands when the code has finished loading. This means for you that there’s no need to wrap $.ga calls in any “page loaded” code (though it will also work there
).