There is a new paradigm taking shape in the world of web analytics. For a long time, the most granular piece of data we collected was the pageview (Figure 10-14). However, with the onset of new technologies, like Flash and Ajax, and the addition of new content types, like movies and widgets, pageviews no longer provide the necessary data to understand user actions.
We need a new, more granular piece of data that describes how visitors interact with our content. In Google Analytics, that new piece of data is called 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 that you can track with Google Analytics.
In the old days (i.e., 2008!) we could track this data as a virtual pageview, but this is really ineffective for two reasons. First, it creates lots of pageviews that pollute our true pageview numbers. Second, the reporting wasn’t built to handle events, so it doesn’t provide any real insight. That’s why we have event tracking.
Event tracking adds another layer of data to the visitor data hierarchy, shown in Figure 10-15.
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 and mobile apps, continue to evolve.
Events do not create a lot of new metrics in Google Analytics. Basically, Google Analytics counts how many events occur. All events, and the attributes of events, are recorded as dimensions in Google Analytics. This makes is possible to perform advanced analysis using events in custom reports and advanced segments.
If you’re wondering how you might use events, consider the following:
Social media tools
Getting Started with Event Tracking
Before we get into the structure of event data, let’s 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 Google Analytics, you don’t need to do any special configuration to answer these questions. Google Analytics does most of it for you.
But with events, you need to create all of the data that will end up in Google Analytics. You literally need to define what data you want Google Analytics 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 collect the correct data.
As we continue this section, we’ll use Google Maps (shown in Figure 10-18) as our example. If I was an analyst for Google 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 business question: which map view is 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 four parts to the events data model: categories, actions, labels, and values.
Categories are buckets that group the actions visitors perform on our web pages. This may be a video player or an Ajax widget. Using our Google Maps example, the category would be “Map.” Remember, the business question we want to answer concerns a feature in the map part of the page.
You can alter the category to meet your reporting needs. Consider that Google Maps appears in multiple languages. If we need to report on the performance of each language version, we may create different values for the categories, specifically one for each language:
- Map – US English
- Map – UK English
- Map – FR French
The second part of the data model is actions. Actions represent the literal actions that visitors perform on our web pages and are grouped by categories. Actions literally tell us what the visitor did.
Lots of actions can occur on a web page. Just think about our map—here are a few actions that our map might have:
- Change view type
- Drag waypoint
- View traffic
- Send email
- Get a link to the map
Because we’re focused on one business question, we’re going to focus on one action: change view.
Warning: Google Analytics will report on all actions independently of the categories they’re associated with. This provides another way to slice the data and investigate how visitors are interacting with your content. However, there is a drawback to this functionality. If you have two actions with the same name that belong to different categories, Google Analytics will sum their data when you’re viewing by action. Be careful when naming your actions. Try to use a unique name so the Actions report will make sense.
Labels describe the action that occurred. If the actions tell us what the visitor did, the value tells us the result. The label value is optional. For the ‘Change view type’ action listed in the types of actions above, we might have the following labels:
- Satellite with Labels
Labels are really important to understanding actions. If an action only has one value, it does not provide any insight into what the visitor did.
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 integer that indicates the value of the action/label combination. The values usually relate back to some type of measurement or a monetary value.
There are no good measurement values associated with our Google Maps data, so let’s assign a monetary value to each action/label. Who knows, maybe someone viewing a hybrid map is worth more than someone viewing a regular map due to the ads Google displays:
- Satellite = 10
- Satellite with Labels = 15
- Map = 5
- Terrain = 0
Values have no units associated with them, so if some action/label combination has units of dollars and a different action/label combination has units of miles, Google Analytics will sum them indiscriminately. It’s best to stick to one set of units.
Learn more about this topic from Google Analytics.
Take advantage of Google Analytics' powerful and free tools to understand exactly how users behave when they visit your website or use your web application. This hands-on guide shows you how to probe general traffic, marketing, and ecommerce information with these tools, and teaches you how to supplement them with add-ons and external tools when you want to dig even deeper. You'll also learn how to create custom reports to analyze specific issues.