http://jsfiddle.net/GTCR4/
Google Analytics
File Tracking
File Tracking
Google Analytics does not inherently track file downloads (i.e. links to images or PDF documents). However, you can manually enable this through the use of JavaScript. There are a lot of great implementations of this and some are already in a JavaScript library but I wanted to take a crack at it on my own, and that's what you see above. There are other variations of this script available, just be aware that for every install of Google Analytics, you should also add some version of this.