Tracking Events with Google Analytics

14 March 11 ,

Google Analytics (GA) generally tracks “pageviews”. That is, when someone visits a page on your website, GA records that information and you can view it in your account. However, there are many things you might wish to track that don’t actually involve viewing a separate page on your site. This certainly applies to fancy AJAX-enabled web applications, but even on an average informational website there are examples. Let’s look at a few.

Things you can track Google Analytics

Downloads

If you offer files for download — perhaps your CV, a whitepaper, e-book, or even just your vcard, you might want to know how many times people have downloaded them. If you’re using a CMS such as Textpattern, you may be able to view such stats. But it might be nice also to have all your stats in one place — Google Analytics.

Google Analytics event tracking

Tracking file downloads as events with Google Analytics

Email links

If you have a link on your site which a visitor can click to send you an email, this doesn’t generate a new pageview, but is something you might want to track.

Outbound links

It’s easy to discover where people are coming from in GA, but you might also be interested in where they are going from your site. If users are leaving your site via outbound (aka external) links, you can track this with GA.

Forms

If you have a form on your site that you want users to complete, you’ll probably know when they have done so (for example, if it’s a contact form, you’ll receive their submitted information). However, it might be useful to know if people start to fill out the form, and then give up for some reason. This is also possible with GA.

How to track these things with GA

All this tracking is accomplished with the help of Google Analytics’ event tracking. It involves adding a bit of javascript to each page, for each item you want to track. The code can be added to “onclick” handlers on each relevant element, or for a tidier approach, can be added with JQuery. Check out some of the links below for more info, or get in touch if you’re interested in adding event tracking to your website.

Comment
No comments yet…Be the first!

Comments are closed for this article.