Event tracking in Google Analytics

Posted on April 28, 2009 Categories: Coding

post author

Written by: Charles

Charles has spent the past few years as the big cheese at thrudigital. On any normal day you will catch him with a milky cup of tea (no bubbles on top thank you very much) and at least 30 browser tabs open.

One of the more exciting developments I have seen lately is the introduction of a feature called event tracking to Google Analytics.

What it allows you to do is register the occurrence of ‘events’ within your pages using JavaScript. Google Analytics then spits out the statistics on your events within the Event Tracking section of your dashboard.

You can also tag events with categories that allow for a breakdown within these statistics.

The JavaScript function that you use to register an event is as follows, straight from the Google Analytics Event Tracking Guide:

_trackEvent(category, action, optional_label, optional_value)

So you have three levels of categorisation through this function: category, action and optional_label. And, you can also record a optional_value.

I did some basic experimentation with integrating this into the Apprentice game that we have developed at thrudigital. I have implemented event tracking on five different categories of actions:

  • Clicked to vote
  • Clicked on a sharing link
  • Clicked on a Twitter profile pic
  • Submitted the contact thrudigital form
  • Clicked on the link to the thrudigital website

This gives us a nice little breakdown of what people are clicking on once they get to our one-page mini-site. We could have even gone one step further and tagged each of the vote events with the name of the contestant voted for – that might be a job for tomorrow…

Theoretically, you could trigger an event for almost any sort of event within the user interface of your web site. You could even do tricky stuff like record how far users get through a form before bailing out. Or even how long users are taking to get through a form on average, using the optional_value field.

If you know of anyone using this new functionality in a creative way, please leave a comment here and let us know.

Follow us:

1 Response

  1. Orval Starnes
    May 29, 2010

    Sup, just found your site on yahoo. You have a ton of sweet posts!


Leave a Reply

Archive

July 2010

June 2010

May 2010

April 2010

March 2010

February 2010

January 2010

December 2009

November 2009

May 2009

April 2009

March 2009

February 2009

January 2009

December 2008

November 2008

October 2008

September 2008

July 2008

June 2008

March 2008

February 2008

January 2008

December 2007

November 2007

October 2007

About Us

A team of nerds, creatives and strategy ninjas based in central London, building websites, social networks, widgets and social media apps.

We have a portfolio that is good enough to make a male peacock blush, and some killer outside-the-box products...in a box.
Ask us a Question

Blog posts