Event Tracking is a feature of Google Analytics you use to track different actions visitors take on your website, such as clicking a button or downloading a file. It is useful for tracking actions on your website that don't take the user to a new page (such as clicking play on a video player).
Since we launched Event Tracking in October of 2007, we have made some changes to improve it. These changes aren't always captured in online tutorials, so we wanted to give an official update on Event Tracking best practices.
From "Double Call" to "Single Call"
After the initial launch of event tracking, we realized that the two-step process of implementing event tracking in Analytics could be simplified to a single call using the _trackEvent() method. In the initial version of event tracking, your implementation involved two steps:
To illustrate, suppose you have a video player that you want to track. In order for the player tracking to show up in your reports under the "Categories" section, you need to provide a category name. We'll use myVideos as an example. If the video has a "Pause" button that you want to track, we can accomplish this by attaching the following call to the "Pause" button on the video player for the Snoopy movie:
When users click the "Pause" button for the Snoopy movie, an event for that category/action combination is triggered.
If your movie player is Adobe Flash based and you use ActionScript 3, check out Google Analytics for Adobe Flash. It provides an intuitive environment for event tracking if you are an Adobe Flash developer.
Additional Resources
What do you use event tracking for?
Since we launched Event Tracking in October of 2007, we have made some changes to improve it. These changes aren't always captured in online tutorials, so we wanted to give an official update on Event Tracking best practices.
From "Double Call" to "Single Call"
After the initial launch of event tracking, we realized that the two-step process of implementing event tracking in Analytics could be simplified to a single call using the _trackEvent() method. In the initial version of event tracking, your implementation involved two steps:
- Setting up the object to track and giving it a name
- Tracking actions, labels, and values on that object using myObjectName._trackEvent(
action, label, value)
- Simply use pageTracker._trackEvent() to create a named category and track actions, labels, and values in one step, not two
- The term Objects was changed to Categories to better reflect the concept of tracking a category of page elements, such as "Video Player"
To illustrate, suppose you have a video player that you want to track. In order for the player tracking to show up in your reports under the "Categories" section, you need to provide a category name. We'll use myVideos as an example. If the video has a "Pause" button that you want to track, we can accomplish this by attaching the following call to the "Pause" button on the video player for the Snoopy movie:
pageTracker._trackEvent("myVideos", "Pause", "Snoopy");
When users click the "Pause" button for the Snoopy movie, an event for that category/action combination is triggered.
If your movie player is Adobe Flash based and you use ActionScript 3, check out Google Analytics for Adobe Flash. It provides an intuitive environment for event tracking if you are an Adobe Flash developer.
Additional Resources
What do you use event tracking for?