Google Analytics has been the go-to service for tracking website page action, demographics, page views and conversions. But I found out I had totally missed out on an important use of Google Analytics that you won’t get without configuration: tracking of events.
This week, I have had to work on tracking page-element interactions, scrolling and Facebook Like and ‘unlike’ on Pulse.ng. Enter, Events Tracking with Google Analytics. Setting up events tracking is pretty simple.
First of all make sure you have Google Analytics Tracking Code installed. The tracking code will look like this:
onClick=”_gaq.push(['_trackEvent', 'Event Category', 'Event Action', 'Event Label']);”
So to track a click event for instance, the syntax will look like this:
<a href=”http://theurl.com”onClick=”_gaq.push(['_trackEvent', 'Event Category', 'Event Action', 'Event Label']);”>Your link</a>
So let’s assume I wanted to track the Twitter link in the bottom of my blog post:
<a onclick=”_gaq.push(['_trackEvent', 'Bottom Social Interaction', 'Seye Twitter Button', 'Clicked the twitter button']);” rel=”publisher” target=”_blank” href=”http://twitter.com/seye”>Twitter</a>
To check out the outcome, you’d have to go to the Google Analytics dashboard. Under Content->Events you’d see the result of your trackings. Pretty simple 🙂