Updated 6/4/2014 and again on 6/1/2015 (with additional event tracking resources at the end of the post)
We’re data nerds and always have been; there’s nothing better than discovering a solid trend in a sea of statistics. Luckily for us, we live in a data-driven marketing age and Google Analytics provides a never-ending supply of info on how visitors behave online.
Interpreting this data to find out if your website is meeting your marketing goals can be overwhelming at times. Plus, looking at traffic types, demographics and devices alone doesn’t tell the whole story about your users and doesn’t do much to improve your conversion rates. The key to unlocking this new data dimension is Event Tracking.
What the heck is Event Tracking? How do I do it?
Event tracking is a feature of Google Analytics that allows you to trace actions whether or not a URL change is recorded. Examples include clicking on links, email addresses, social media icons, or file downloads.
Step One: Decide What Action to Track
When thinking about what you want to track, go back to your marketing goals. Let’s say you are a mortgage broker and you just put up a new whitepaper about the recent mortgage law changes that you want people to download. This would be a great action to track.
Step Two: Add the Code
This code will need to be added within a link on your site.
Here is the basic code that you will need to start with (for the async tracking code of Google Analytics):
- onClick=”_gaq.push([‘_trackEvent’, ‘Category’, ‘Action’, ‘opt_label’, ‘opt_value’]);”
If your site is using Universal Analytics, you’ll need to use this code:
- ga(‘send’,’event’,’category’,’action’,’opt_label’, opt_value)
There are a few variables that will change with each different event you track:
- Category – grouping events into desired tracking groups
- Action – the action the user takes
- Label – to differentiate this event among the others (optional)
- Value – perceived dollar value of event (optional)
Since we want users to download the whitepaper, we’ll change the following:
- Category: downloads
- Action: click
- Label: whitepaper
- Value: 0
The new custom code should look like this (async example):
- <a href=”http://www.desiredlinkhere.com” onClick=”_gaq.push([‘_trackEvent’, ‘downloads’, ‘click’, ‘whitepaper’, ‘0’]);”> Name of Link Here</a>
Step Three: Set up the Events as Goals in Google Analytics (if desired)
You have the option of setting up events as goals in Google Analytics, then you will be able to see them in the conversions section of your account. If not, the events should feed into Google Analaytics in the behavior section automatically. When logged into your Google Analytics profile:
1. Go to the Admin section
2. Select your profile
3. In the tabs select ‘Goals’
4. Then click on the “+Goals” to add your first goal.
Name your goal, choose the type, and enter the category and action. Then, fill in the Goal Details to match the variables from the code generated in step two.
Tracking your Events
To see results, you’ll need to go back to Reporting. Go to the “Content” section and click “Events”. There you’ll see a list of events, which you can filter by category, action or event label. Or, you can watch real time analytics and track your events as they happen.
Some other events you may consider are:
- Banner Ads
- Social Links
- Form Completions
We hope you enjoy gaining more insight into how your users are interacting with your site through event tracking. If you have a question or are already having success with event tracking, please leave us a comment.
Update: To learn another technique for adding event tracking to you site, view my new event tracking for Google Analytics post for WordPress sites.
Updated: 5/16/2014 – We’ve recently released a Event Tracking plugin for WordPress sites, learn about it here: Gravitate Event Tracking, Our New WordPress Plugin
Updated: 6/1/2015 – If you are interested in Google Tag Manager, here is a resource for event tracking with GTM.