The Ultimate Guide To Google Analytics Event Tracking
The following is a guest post by Future Buzz community member Ed Baxter.
Event tracking in Analytics is awesome! There really is no other word to describe it, so it’s unfortunate when it feels like everyone isn’t making the most out of an amazing resource built directly into Google Analytics. With that in mind, I wanted to share some of the ways that I use event tracking on real projects…
For those who haven’t used event tracking before…
(read on to know the score!)
Event tracking is very simple to set up. It takes just one line of code to fire an event to Google to track something; this could be a PDF download, a video play and so on. The code required to track an event is shown below:
As you can see, a typical Event is made up of several simple parts.
- First we make a push to Google and tell it we are tracking an event.
- Then we are telling Google the category name; for the contact email link I’ve assigned it to the category of “Contact”.
- Then we tell Google the action taken. In this example the user has clicked the email link, so I’ve call this “Click Link”.
- Then we are attaching a label to the event. I’ve set this as “Contact Page Sidebar”. On the real page, it has several links to the contact email address, so by using the label I’ve allowed more detailed tracking in Analytics. This is especially handy for working out which email links are being most effective.
The 4th option hasn’t been included in the example however it allows you indicate the event will not be used in the bounce rate calculation. We’ll come back to this later.
If you are new to event tracking then I’d suggest you check out Google’s official page for it, it has all the information you need to start tracking your events!
Event tracking in the real world
Now we’re all up to speed we can get stuck into the good stuff. Events can be used in all sorts of clever ways to add that additional level of detail. Here are just a few:
Downloads
Downloads to files typically aren’t tracked in Analytics by default. They don’t fire the tracking code and thus don’t show up in your reports. Not ideal! However, you can attach event tracking code to them and start measuring your downloads.
SEOmoz is using events to track outbound links to their Firefox toolbar.
Outbound Links
Ever wondered how much traffic you are referring to various websites? Event tracking on outbound links is a great way to measure this.

Live Help
Many ecommerce sites use live help to aid their customers when making purchases or by answering their questions directly and quickly. Many of these systems don’t natively integrate with Analytics however we can attach a click event to the live help link.
Baskets and Checkouts
Many websites have multiple links to their Checkout page or their Add To Cart page. Event tracking can be used to see where users are actually clicking on the page.

In the image above, event tracking is used to track where visitors are adding products to the cart from. In this case, they are adding from the category page.
Error Reporting
Tracking where users are having issues on your site is highly important if you’re interesting in improving your conversion rate. Let’s consider a typical checkout by a user: they go first to the checkout page, enter all their details, hit the submit button and then get an error on their email address or their post code. By default, Analytics doesn’t track this error; it will show another pageview but nothing more.
By firing an event, we can see what is causing issues when people progress through our forms. Over time we can see areas of the form that are problematic and take steps to correct them.
Video Plays
If you host your own videos then you can also use event tracking to see how often they are being watched.
Get events working with goals
An added bonus to events is that they can be used to create goals. Rather than setting a URL destination or a visit duration you can carefully select what type of events you’d like to track as a goal as shown below…

Use event tracking for the right reasons
Now we’ve looked at a good number of real world uses of events you might notice that it’s possible to get carried away with them. Events are powerful but they aren’t always the right solution to track what you need.
Virtual pageviews, for example, are another fantastic way of tracking data that is usually hidden. You tell Google a specific page has been viewed by using the code below:
<script type=”text/javascript”>_gaq.push(['_trackPageview', '/contact/success/']);</script>
This is very handy if you wanted to track an accordion checkout page which shows multiple sections but doesn’t “leave” the page.
Knowing when to use events or when to use virtual page views is very important if you want to keep your data clean. I recommend checking out this article.
I hope this has provided you with a better understanding of events and where you can use them. Because data is so important, it’s vital that we collect as much of it as possible to see how visitors are using our site and where we can improve.
If you have any other nifty ways of using events then I’d love to hear about them in the comments below.
Ed Baxter is the SEO manager for Ignition Search – a PPC Management & Internet Marketing agency based in Sheffield. In his spare time he’s an avid mountain biker and loves all things to do with the web. Follow Ignition Search on Twitter!









Nicholas Redd replied | Oct 5, 2012 (1 comment)
We use Google for just about everything in our business. Google Analytics is by far one of the most important. We thoroughly analyze on a weekly if not bi-weekly basis. Thanks for this article I’m especially excited about tracking outbound links as mentioned above.
Ron Lee replied | Oct 8, 2012 (2 comments)
Ron Lee here, Author of, “The Ultimate Guide To Google Analytics”. So we noticed your title via Google Alerts. The Ultimate Guide To Google Analytics Event Tracking. Just wanted to clear the air that “The Ultimate Guide To Google Analytics” is our published work available at either here http://ebookstore.sony.com/ebook/ronny-lee/the-ultimate-guide-to-google-analytics/_/R-400000000000000761711 or here http://www.amazon.com/Ultimate-Guide-Google-Analytics-ebook/dp/B008IHTBFC/ref=sr_1_22?ie=UTF8&qid=1349727071&sr=8-22&keywords=Google+analytics
Thank you.
Sincerely,
Ron Lee
Author
http://www.GoogleAnalyticsEbook.com
The Ultimate Guide To Google Analytics
Adam Singer replied | Oct 8, 2012 (597 comments)
Thanks Ron for the link — no confusion intended, our guest poster came up with this idea completely independently.
Ron Lee replied | Nov 8, 2012 (2 comments)
Just wanted to say thanks again Adam. Top notch professionalism here. Keep up the great work!
Stephen Hamilton replied | Oct 8, 2012 (1 comment)
Great article, thanks!
I’m intrigued by the possibility of using this for error tracking.
Could you expand upon this, possibly with examples of the event tracking code of how you would do this?
Angie Schottmuller (@aschottmuller) replied | Jan 20, 2013 (2 comments)
I agree! The idea of using event tracking for web form validation error tracking is very intriguing. I’m gonna have to look into that further! That’s a great metric for scoring user experience.
Stephen, I’m thinking the event tracking _gaq.push JavaScript call would go on the line just before the alert prompt or whatever visual error indicator is presented to users.
Preetam replied | Nov 21, 2012 (1 comment)
I am not really a big fan of analytics and never really cared much about going so deep about stats.. so few hours ago I added analytics code on my blog and verified it with my account.. but for some reason I am not able to track goals as it is showing in your post.. any idea what could the reason be?