|
We use Google Analytics here because it is a great tool to help us understand our visitors. Today we're going to talk about a way to track if visitors download files or click on links to external websites.
Tracking this sort of behaviour may be really important to see if people are interacting with the web site the way intended. For example, businesses that have their brochures or product catalogues downloadable as PDF's.
The official Google Analytics help says that any link can be monitored if this script is added in the link:
onclick="pageTracker._trackPageview('/file_name.file_extension')
Adding this script to every download link on your website can be a laborious task.
Tracking downloads automatically
The simple solution we found is to use a JavaScript that automatically attaches event listeners to files which are downloaded from your web pages.
What sort of downloads can you track automatically?
Using the javascript you can track the following file extensions:
- doc, eps, jpg, png, svg, xls, ppt, pdf, xls, zip, txt, vsd, vxd, js, css, rar, exe, wma, mov, avi, wmv, mp3
In addition to tracking these downloads, the JavaScript will also track clicks on links to external websites and include these in your Google Analytics statistics.
How do you install the tracking JavaScript?
Is it really that simple?
Yes, but note that this tracker is written for Google Analytics new tracking code which uses the lighter ga.js. If you are using the old tracking code with urchin.js you can still track file downloads but not using this link tracking JavaScript. Check out this site for more information on tracking download links with the old tracking code.
How might download statistics be useful?
Taking the example of a business that has its product catalogues downloadable as PDF's: If through Google Analytics they can see that users
are not downloading their catalogues they might consider redesigning the web
pages to give more prominence to these downloads.
Another example could be a software company wanting to measure how many users download their software from their web site. Using this JavaScript they could measure the number of downloads and even set up goals in Analytics to measure the conversion rate.
How will you use the statistics generated by this Javascript? Please post any comments or questions you have about this JavaScript in the comments below.
|
February 12, 2008
Votes: +0