Winning the Internet

Track outbound links with Google Analytics Event Tracking

google analytics event tracking

If you’ve got just a basic Google Analytics setup, you’re likely missing out on a lot. For example, have you ever noticed that Google Analytics only tracks clicks on links that lead to webpages that are part of your site?

For most of us, clicks on links to other sites aren’t tracked at all. This can be a major drag, especially considering that donate and take action links often leads to third-party sites.

Fortunately, the good folks over at Google have created a solution! It’s called Event Tracking. With the right coding, you can track outbound links and just about any type of interaction within a page.

First you’ll need to add some code to your site – I’ll explain exactly how to do that in a moment. Once your code is in place, you’ll be able to view clicks on outbound links by looking at the Top Events report in the Content section of Google Analytics.

Your report will look something like this (depending on how you add the code to your site). First you’ll see something like this report that shows the total number of events and unique events (think clicks).

google analytics outbound rollup

Once you drill down (I clicked on Outbound Link in this example), you should see a list of the links that were clicked, like this:

google analytics outbound links all

Now you’ll always know exactly how many people clicked on your donation link!

I my opinion, outbound link tracking is the easiest type of event tracking to implement. To set it up, you’ll need to add some code to your site. There are two ways to do this.

Manual link tracking

To manually track clicks on outbound links as events, all you need to do is add a bit of extra code to each link. If your coding skills are limited and you’ve got a small site with only a few outbound links, this could be a good choice. Here’s some example code from Google:

<a onclick="_gaq.push(['_trackEvent', 'Outbound Links', 'Click', 'Google']);" href="http://www.google.com/">Google</a>

To use this code for your link, just copy and paste the code, and make the following changes. http://www.google.com/ should be the url you’d like to link to. The first Google (between the single quotes) should be whatever you’d like to name your link, and the second Google (between the carrots) should be the text you want to be hyperlinked.

Automatic link tracking

If the idea of manually tagging every link on your site makes you want to cry, you should probably try automatic link tracking. This involves making sure you have asynchronous tracking installed on your site, and adding a little bit of JavaScript code that will automatically tag the links for you. This is fairly technically involved, so I won’t go into the details of how to do this here. Axllent.org has a pretty good how-to though.

Tracking video interactions and other actions

You can also use event tracking to track how people interact with a video on your site (play, pause, etc.), or anything else that involves clicking within a page (initializing a game, etc.). The coding involved here is a bit more complex than with outbound links.

Unfortunately I haven’t yet found a resource that breaks this down and makes it easy to understand. If you’ve got a good source, please share it in the comments! However, if you’re feeling motivated and you know how to code, Google’s code site has some instructions.


About Melissa Foley

Melissa is the New Media Program Director for Netroots Foundation and Lead Mentor for New Media Mentors. She aims to use her business school background and nonprofit experience to teach organizations to use new media tools strategically.

,

Comments

  1. Alex Bernardin says:

    great post! I've heard rumblings that outbound click tracking is sometimes thwarted by the browser jumping away to the new site before it has time to process the event. Have you consistently seen this approach produce the numbers you would expect?

  2. Yi Huang says:

    You can also check out our product http://www.skyglue.com. SkyGlue automates GA event tracking and tracks all On-Page activities with one line JavaScript, such as links, buttons, images, videos and many more.

  3. Joe Anucha says:

    So where do we paste the manual tracking code? What's the idea? head or footer? thanks for the simplest post.