Tracking clicks to outbound links with latest GA script

The latest script version for Google Analytics enables you to track clicks on outbound links. By manually tagging each link to other sites using a javascript function, data on these clicks will be gathered in the content reports.

Before trying out this technique, please be sure you’re using the latest ga.js script and not the legacy urchin.js version of the script. The updated Google Analytics code can be found by editing the targeted website’s profile in the welcome screen and by clicking ‘Check Status’ at the top right corner of your website profile. Both urchin.js as well as ga.js based code is provided here.

Tracking clicks to outbound links

Each outbound link on your site will look something like this, in HTML: <a href=”http://www.othersite.com”>Other site</a>. All you need to do is add a few parameters to enable tracking of outbound links, which will make it look like the below example – basically telling the Google Analytics script to treat the click as a page view, with a specific label.

<a href=”http://www.othersite.com” onClick=”javascript: pageTracker._trackPageview(’/outgoing/LinkToOtherSite’);”>Other site</a>

As you might’ve noticed, there’s a tag set inside the code named LinkToOtherSite. This tag is an artificial page name which identifies that particular link and will show up that way in the reports. You can change this tag for each individual link, making it easier for you to identify clicks on outgoing links. Adding a folder structure (‘/outgoing/’ in this example – customizable also) allows you to group click data with one recognizable phrase.

In the Content reports within Google Analytics, these outgoing clicks will be marked with the /outgoing/ phrase, but you can easily filter these out by using the exclude/include filter at the bottom of the reports.

Tracking outbound links in a separate website profile

Including clicks to outbound links in your reporting means they will be counted as page views, which means that will skew your data. To avoid this problem you can opt to open a separate website profile to collect these outbound clicks. In the website’s profile you can apply a filter which can be set to exclude traffic to a specific folder (‘/outgoing/’ in the above example), whilst in the new website profile you can set Google Analytics to only collect data from traffic to /outgoing/.

A few tips

  • Besides being descriptive when tagging your outbound links, it’s wise to keep a log of the phrases you’ve used for tagging, so you know which tag refers to which link. Obviously, the more outgoing links you have the more important this becomes
  • If you want to track the outbound clicks of multiple pages on your site, but you want to analyze clicks made on your site’s individual pages, you can easily use the /outgoing/ directory structure. For example, /pageA/wikipedia and /pageB/wikipedia will be able to tell you how many of the outbound clicks to wikipedia came from page A and how many came from page B.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • Furl
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis


Post a Comment »








Safari hates me

Comment Guidelines

  • Hyperlinks are automatically generated.
  • <em>italic</em>
  • <strong>bold</strong>