The Only World-Standard SEO Software


Download Now
SEO PowerSuite
SEO PowerSuite Hot-new version
Supported OS

Google Analytics in Very Plain Language. Part III: Tracking External Links

| Posted in category Analytics Google

SEO NinjaHi there to all aspiring Google Analytics Ninjas! Your web analytics framework should have become more goal oriented and you know how to track the performance of your website now. For those who are unaware, in Google Analytics in Very Plain Language. Part II we talked about GA goal types and learned how to set them up.

When talking about URL Destination tracking we mentioned that in some cases it may be necessary to count the number of file downloads (e.g. pdf brochures, video presentations, pdf products catalogues, etc). Such actions taken by the visitor in most cases may be considered a goal completion since they may end up with online or offline conversion. Alternatively, you may have banner ads, affiliate links, mailto links, which point to external pages, but the click on them may also be considered a goal completion. The default installation of Google Analytics does not allow tracking external links or file downloads, but fortunately there are a few easy tweaks.

  • Set up tracking code and goal conversions manually for every external link

It’s a good option if you have one or two external links, but you will have hard times to implement tracking if your website contains hundreds of links. There’s a pretty good tutorial at Google Help Center

  • Tag external links automatically using event tracking

This is a more advanced technique but it is fairly easy to implement. Read on for the ‘how to’.

Step 1

Download the required components. You need to download 2 files:

  • The latest build of JQuery library (it’s a Java Script library that facilitates handling of events, documents, html pages). At the time when this post was created Jquery 1.5.1 was available from the official website.
  • A Java script Link-Tracker Plugin that will be tagging your external links.

Step 2

Upload jquery-1.5.1.min.js and link-tracker.js to your websever. (For more information on how to handle your files on server read Google Analytics in Very Plain Language. Part I. Create a js folder on your server, if it doesn’t exist yet, and put both files there.

Step 3

Edit the template of your website. Make sure the following changes are applied to every page where you want to track external links.

  • Add the following strings right before closing < / head >:

Don’t forget to replace example files’ paths and names with the ones that apply to you.

  • Add the following strings before closing < / body>:

The set up is over.

How it Works:

If the set up is correct, in 24-48 hours you should see Event Tracking link in Content reports section of your Google Analytics account, see below:

Google Analytics Screen

You will see the events report. A typical events report looks like this:

Google Analytics Screen

You may drill the report down to get the information about outgoing links and mailto links.

The Link Tracker plugin categories all the events in the following way:

- Category Action
Mail Addresses Links Mailto
External links Outgoing
File Downloads Downloads File Extensions

Supported file extensions: pdf, zip, rar, tgz, gz, gzip, jpg, png, svg, gif, doc, eps, xls, ppt, xls, txt, vsd, js, css, exe, wma, mov, avi, wmv, mp3. You may edit the .js plugin file and add any other file extensions, as you see necessary.

Now if someone downloads your .pdf brochure or contacts you using mailto link you may track the exact number of these events, count them as goals, and make necessary adjustments to your website to improve the performance.

Looking forward to your comments and success stories. Cheers!



back to SEO blog