Event Tracking

GoSquared LiveStats 3 - Event tracking shown on the far right

Sometimes you want to know more than just which page your visitors are viewing. If you're developing a web application using flash and/or javascript, you could take advantage of Event Tracking in LiveStats to monitor more of the actions visitors make.

Why use Event Tracking?

Event tracking provides an in-depth analysis of your user's actions on a page. The basic behaviour of the Tracking code is to record a pageview and keep track of how long that user is viewing the page. With an implementation of event tracking, you are able to unveil events you wouldn't normally see, providing a deeper insight into the usability of your page, the behaviour of your visitors and the functionality of your webpage.

For example, if one of your pages has got a tabbed interface controlled by javascript, you would normally only be able to see the inital pageview on that page. However with Event tracking, you can start receiving information about which tabs the user is clicking on.

Implement Event Tracking on your Website

Event tracking is implemented using a simple function:

GoSquared.DefaultTracker.TrackEvent('Event Title', [string subtitle or object parameters]);

The function accepts two arguments, the event title, and the event subtitle or parameters. To set a subtitle for the event, the second argument will be something like "My Tab". If you need to convey more information about the event, you can construct a key => value object with a list of parameters.

For our tabs example, we might set an event like this:

GoSquared.DefaultTracker.TrackEvent('Changed Tab', 'Tab2');

You can call this function inside a javascript "click" event for that tab, for example. When the event is triggered, LiveStats will append the event information to the user's browsing trail. Events are represented by a circular "i" icon:

If we also needed to know, say, the exact time this click happened, you could include a timestamp as a parameter, and construct an object with the information you would like to report to the LiveStats interface. Here, we pass the function an object containing the tab name and time of click:

var d = new Date();
var curr_day = d.getDay();
var curr_month = d.getMonth();
var curr_year = d.getFullYear();
var curr_hour = d.getHours();
var curr_min = d.getMinutes();
var time = curr_hour+':'+curr_min+' '+curr_day+'/'+curr_month+'/'+curr_year;

GoSquared.DefaultTracker.TrackEvent('Changed Tab', {tab: 'Tab 2', clicktime: time})

To use one of these properties as the subtitle, like in the original instance using just a single string, supply it using the caption: key. This key won't show up in the tooltip, and will be used specifically for the subtitle.

How does Event Tracking help me?

Gone are the days where you cannot apply usability testing to flash applications, websites, widgets etc;  you can also call this function from inside a flash application to track user activities within that application.

Event tracking is available on all GoSquared plans.

Last modified: 4 February 2011 18:04
Get Satisfaction
Follow us on Twitter
Send us an Email
Call us +44 (0) 20 8144 0401