Wednesday, December 17, 2008

Google Analytics Feature Activation: Event Tracking

"We are happy to let you know that the Event Tracking feature is now available in all profiles for the following Google Analytics Account ID: 123456"

This simple phrase means a lot. It means Google is enabling another feature that raise the bar to a new level and continues to significantly alter the playing field for any low to mid end competitors.

We are not bound to measure page views, visits and visitors anymore. We can truly measure significant activities going on our sites regardless of the way we decide to implement them: AJAX, Flash, Silverlight, widgets or others. Although there was ways to track downloads, video plays and other tricks using the regular page views, the side affect was also that some reports and metrics were affected. With events, a page view is a page view and an event is clearly an event.

Using event tracking

  1. Update your ga.js file
  2. Use the _trackEvent(category, action, optional_label, optional_value) function in your code.

    • The category is pretty obvious: Videos, Download, etc.
    • Action should be something like "Play", "Pause", "Stop", or a timestamp
    • The label allows you to distinguish, for example, which video is being played
    • The value is a way to tell Google Analytics about a timestamp, a count, or any numeric value that will be summed and averaged for each action and label
  3. See the results under Content/Event Tracking in Google Analytics

Other cool stuff

A set of new event timer functions _recordStartTime(), _recordEndTime() and mouse over event tracking _trackMouseOver(). I can already imagine scenarios where those calls will come in handy!


  • Max of 500 events per visit... however, this should be plenty!
  • If an event is fired on the first page of a visit, the visit will never be counted as a bounce. A bounce is usually defined as being a single page view, but since you fire an event, there are now two things happening, thus this visit isn't a bounce anymore. That one is a bit more tricky and could significantly affect some reports, segmentation and other calculations.