jQuery Google Analytics Event Tracking Using HTML Attributes

03/07/2013
Share

Setting up Google Analytics event tracking can be a pain sometimes. Often you may want to track a dozen or so clicks on a page that doesn’t make and post backs so you end up with a bunch of spaghetti JS, wiring up events and click handlers.

It’s just messy. So I write this little bit of script that allows you to enable events to be fired on clicked elements with simple HTML attributes.