One of the major new features announced by Google at the EMetrics summit is event tracking. There has been a lot of discussion in our industry about tracking events and only a few vendors offer this feature. I believe that Google is the third. Anyway, this post gives an overview of the new feature. Part 2 covers the actual implementation and part 3 covers the reporting.
What Are Events
Events are actions that visitors take on a web page that don’t generate new pageviews. Interacting with a video player, a widget or an audio player are all common events. Tracking these interactions provides a lot of insight into what visitors are doing on a page.
In the old GA we could track this data as a pageview. But this was really ineffective. First, it created lots of pageviews that polluted our true pageview numbers. Second, the reporting wasn’t built to handle events so it never provided any real insight. That’s why we now have event tracking.
Event tracking adds another layer of data to the visitor data hierarchy:
Visitors
Visits
Pageviews
Events
Now we can really get a good idea of how visitors are engaging our interactive content. This will be vital as web technologies, like Ajax and Flash, continue to evolve.
Every time an event occurs GA will increase the event counter. So if we’re tracking the click button event, GA will show us an agregate count of the clicks. I’ll cover the reporting in Part 3.
Start With Business Questions
Before I get into the structure of event data, I want to talk about analysis. All analysis starts with a business question. What is the most popular organic keyword that visitors searched for? How many sales did I have last week? What was the revenue for a specific campaign? Normally, when you’re using GA, you don’t need to do any special configuration to answer these questions. GA does most of it for you.
But with events, you need to create ALL of the data that will end up in GA. You literally need to define what data you want GA to collect both in name and in value. If you don’t know what business questions you want to answer, you won’t be able to create the correct data.
As I continue this post, I’m going to use an example, Google Maps. If I was an analyst for Maps I would want to answer a lot of questions:
How many people use the zoom and do they zoom in or out?
Which map view is most popular: map, satellite, hybrid, etc.
How many people drag a map waypoint to a new location?
To make things easy, let’s focus on one question: which map view its the most popular. So now that we know the question we want to answer, let’s talk about the data we need to answer it.
Understanding the Data Model
There are 4 parts to the events data model:
Objects
Actions
Labels
Values
Objects
Objects are parts of pages that we want visitors to interact with. This may be a video player or a cool Ajax widget. To continue our example, the object would be ‘Map’. Remember, the business question we want to answer concerns a feature in the map.
Actions
The second part of the data model is Actions. Actions are attached to an object and represent the actions that visitors perform on our object. Actions tell us what the visitor did.
There can be lots of actions associated with an object. Just think about our map. There are so many things that a visitor could do. But we want to define actions that relate directly to the business questions. Here are a few actions that our Map object might have:
Zoom
Change view type
Drag waypoint
Because we’re focused on one business question, we’re going to focus on one action: ‘Change view type’.
Labels
Labels quantify the action that occurred. If the actions tell us what the visitor did, the value tells us the result. So, for the ‘Change view type’ action that I created above, I might have the following labels:
Satellite
Map
Hybrid
Street view
Labels are really important to understanding actions. If an actions only has one value it does not provide any insight into what the visitor did.
Values
The final part of the data model is Values. Values are optional but can provide a lot of insight into certain events. Values can be any type of numeric data that indicates the value of the action and label. While there are not may good values for our example, let’s assign a monetary value to each label. Who knows, maybe someone viewing a hybrid map is worth more than someone viewing a regular map:
Satellite 5
Map 10
Hybrid 15
Street view 20
Values can also be monetary making it easy to identify what actions have real value.
Pulling it All Together
So let’s look at our business question and the data model we’re going to use to answer it.
Questtion:
Which view type do people use more?
Object:
Map
Action:
Change view type
Labels & Values:
Map 5
Satellite 10
Hybrid 15
Street Level 20
The next step is to implement the data model using event tracking code. That’s covered in Part 2. Oh, if the Google Maps team is reading, call me. I’m more than happy to lend a hand. :)
Nice work! Will be very nice to see if someone watched a video or listened to an audio track within a page…
Question, what is the cap on number of events? Does this upgrade open up the 4 goal limits?
Thanks
-Kevin
Hi Kevin,
Thanks for the comment. I believe the limit on events is 500 per visit, but don’t hold me to that. Unfortunately the new upgrades do not include any changes to goal functionality.
Thanks for reading and for the comment.
Justin
Excellent post Justin.
I liked the way you elaborated carefully on the four components of events: Objects, Actions,Labels, Values.
Your post gives us the right knowledge on exactly how to go about implementing event tracking.
Thanks,
Jahangir
finally! someone shows IN DETAIL the necessary steps. great post, made my day a LOT easier :)
Maybe this is a silly question but… in your example
var mapEventTracker = pageTracker._createEventTracker(‘Map’);
I presume you have to state in the code for the page that the object is map – where do you do this?
For example this object is on my website –
what is the object name?
Rob,
The GA code for event tracking has actually changed. You no longer need to create an event object, You just need to add the event tracking code when the actions occur in your code.
Check the GA code site for the updated code.
Best,
Justin
Hey Justin,
Can you confirm with the updates that we don’t need to call trackPageview before trackEvent?
I don’t need to place my GA script above trackEvent in the new method, correct?
Thanks!
Josh,
You don’t need to call trackPageview() before you track events. HOWEVER, you do need to call initData(). Also, if you don’t call trackPageview() then GA will not create a visit for the visitor, this can lead to some funky data.
Thanks for the question,
Justin
Excellent post Justin! It’s kinda painful for a non-techie to be reading the GA documentation itself – i’m glad this clears things up a lil
I am regularly reading books about analytics and now start reading your blog you are doing great work, Congrats :)