Tracking downloads in Google Analytics with jQuery

Google Analytics (and other similar services) aren’t 100% reliable, but they give a valuable insight into what the visitors to your site are up to. One thing they won’t do is track clicks on download links, unless you specify an onClick action for each link.

But here jQuery comes to the rescue – just a few lines of code will have all links to whatever filetypes you need tracked in Google Analytics as Events. Another common use of the same technique (with a few minor changes to the code) is to track clicks on outgoing links.

Read more