How to track downloads and external links through Google Analytics

This post is continuing on from yesterdays post. Another great tip from Niamh from IQ Content that will be of great benefit to Affiliate Marketers is the ability to track downloads and external links through Google Analytics. They have even gone to all the trouble of making it very easy for you by making a script that will automatically track all downloads.

This will track the following file types:

  • PDF (.pdf)
  • Microsoft Word (.doc)
  • Microsoft Excel (.xls)
  • Microsoft PowerPoint (.ppt)
  • Microsoft Visio (.vsd)
  • Microsoft Visio XML (.vxd)
  • ZIP Archive(.zip)
  • RAR Archive (.rar)
  • Text file (.txt)
  • Downloadable Javascript file (.js)
  • Downloadable CSS file (.css)
  • Executable (.exe)
  • NEW Windows Media Audio (.wma)
  • NEW Quicktime (.mov)
  • NEW Audio Video Interleave (.avi)
  • NEW Windows Media Video (.wmv)
  • NEW Mpeg Layer-3 (.mp3)

How to use the Script:

  1. Add the custom script onto your server, eg. /scripts/taglinks.js
  2. Add an extra line of code to every page on your site, immediately before the ga.js GA tracking code

How to monitor downloads:

The script scans each page and autotags all downloads, mailtos and external links with ‘onclick events’.  This means that every time a visitor clicks one of these links, a virtual page view is sent to GA.

The virtual page views appear in the ‘Top Content’ report in GA and they look like this:

Downloads:                        /virtual/download/page/file-name/

Mailtos:                              /virtual/mailto/page/email-address/

External links:                    /virtual/exlink/page/destination-url/

Each time one of these events takes place,

  • the name of the downloaded file is logged,
  • the email address to whom the email is sent is logged, and
  • the destination of the link the visitor followed off your site is logged

Further, in all cases, GA logs the page from which the virtual page view was triggered.  This is valuable data:

Consider a scenario where visitors have the option to download a newsletter from your home page or from your publications page.   By measuring the page from which users launched the download, you have full visibility on which page generated more newsletter downloads.  Note you may have more than one line entry in ‘Top Content’ for any given PDF.  Each line item records each location where the file was downloaded.

How do I structure my account?

You can measure what you want to measure.  Here’s how.

  • If you want to isolate all of these virtual page views, simply type /virtual/ in the ‘containing’ field at the bottom of ‘Top Content’
  • If you want to isolate just the downloads, type /virtual/downloads/ into the ‘containing’ field at the bottom of the ‘Top Content’ report.
  • If you want to isolate just external links type /virtual/exlinks/ into the ‘containing’ field at the bottom of the ‘Top Content’ report.
  • If you want to isolate just mailtos, type/virtual/mailtos/ into the ‘containing’ field at the bottom of the ‘Top Content’ report.

You get the gist.

For example, to isolate only the file downloads, type, /virtual/downloads/:

top-content-virtual-download-illustration1

The third entry indicates that there were 39 downloads (pageviews) during 36 sessions (unique pageviews) of the file PM18012008.pdf, launched from the page http://www.iqcontent.com/about/jobs/ in the time period selected.

Popularity: 18% [?]


This is some text prior to the author information. You can change this text from the admin section of WP-Gravatar  To change this standard text, you have to enter some information about your self in the Dashboard -> Users -> Your Profile box.


Related Posts

You can get our blog posts delivered for free by email every day - simply add your email address to the box below or alternatively grab the RSS feed.

8 Comments For This Post

  1. Dallas MoversNo Gravatar Says:

    I have been trying to figure out how to track external links and downloads for months! Thanks so much for linking to that JS script.

  2. YachtversicherungNo Gravatar Says:

    Good solution!
    I provide a lot of pdf´s on my webpage and I was looking for an analytics tool in order to find the most popular ones.

    Thanks!

  3. Anne FoxNo Gravatar Says:

    Wow! It’s another useful item for everybody. They could easily determine, which one among their list is much appealing to their visitors.

  4. pamelaNo Gravatar Says:

    Thanks for the post i was find a article on the same topic and now i find it. Very good post and the way to explain is also very nice

  5. Lee Ka HoongNo Gravatar Says:

    I’ve been using Google Analytics when I first started my blog and website, but I never knew about this feature. Anyway, thanks for sharing Leo, I’m going to check mine too.

    Thanks,
    Lee

  6. softNo Gravatar Says:

    I’ve been looking for this tutorial.
    It’s really helpful. Thanks for sharing

  7. Case ErnstingNo Gravatar Says:

    Fantastic find! thanks for the update. I’ve been trying to figure out how to track downloads for awhile now and this is the easiest method I found. Cheers!

  8. LeoNo Gravatar Says:

    Thanks for checking out th blog, Case!

Leave a Reply

  • Popular
  • Latest
  • Comments
  • Tags
  • Subscribe
Advertise Here

Our Flickr Photos - See all photos

leowebawardsiwaheader09DProfileszszaboovaMy DocumentsMy PicturesWeb awards 011DProfileszszaboovaMy DocumentsMy PicturesWeb awards 009DProfileszszaboovaMy DocumentsMy PicturesWeb awards 021DProfileszszaboovaMy DocumentsMy PicturesWeb awards 010