Following my previous post in this two-part serties, I show you how to overcome two limitations of Google Analytics:

  1. This post – Automatic tracking of file downloads and outbound links
  2. Last post – Improve your SEO tracking in Google Analytics - previous post

The first is a real pain in the bum for webmasters of content heavy websites who need to track non-standard click throughs such as file downloads and outbound links. The second is an major limitation for Search Marketers requiring regional search engine detail for SEO campaigns;

However, Google Analytics is a very flexible product and a little bit of custom JavaScript can go a long way – so I have developed simple JavaScript “plugins” to over come these limitations…

Automatic Tracking of file Downloads and Outbound links

On a small scale, tracking file downloads and outbound links is straightforward for a webmaster. All that is required is a modification of the link anchor to include an onClick event handler – either to call a virtual pageview, or track as an event. That’s fine for a handful of download/outbound links, but what if your site contains hundreds, thousands, or even hundreds of thousands of these…? This script automates this for you.

Add 1 line of code to your pages and this JavaScript extension will scan all your page links in the background – as the page is loaded by your visitors – and automatically adjust them accordingly.

Read more about automatic tracking of file downloads and outbound links >>

Summary of features:

  • No manual modifications of your links required, just drop this script into your page header
  • Auto-track File downloads – MS Office files (doc/x, xls/x, ppt/x), exe, zip, txt, pdf
  • Auto-track mailto: links
  • Auto-track outbound links i.e. those not local to yourdomain.com
  • For each type (download, outbound, mailto), select if these are tracked as a virtual pageview or an event
  • Multiple pageTracker support – works with multiple GA page tags.
  • Improved bounce rate calculation – can optionally set a timeout to redefine a bounced visit e.g. set a single page visit a bounce, only if time on page is 30+ seconds

What it looks like

Without this script there is no outbound link or file download reporting by default. With this script you can view these as either virtual pageviews or events…

Using virtual pageviews for tracking file downloads and outbound links:

virtual-pageviews.png

Using events for tracking file downloads and outbound links:

outbounds-downloads-as-events.png

Find out more about this extension >>

Also read Part 1 of this series – regionalisation of Search Engines for SEO