Analytics Market Chart

Track File Downloads in Google Analytics

Google Analytics doesn't automatically track downloads of PDFs, Word and Excel documents, videos, or other files from your website. The Google Analytics tracking code relies on JavaScript, which can't be embedded into these documents.

Fortunately there are a few ways you can configure Google Analytics to track file downloads.

1) Use LinkTagger
Linktagger is a free add-on utility that will automatically track file downloads and clicks on outbound links. The Linktagger wizard can be accessed on the Free Tools page.

2) Use Events to Track Downloads
Each time a visitor clicks a link to download a file, an entry will be added to the the Events report section. You are also able to define 3 descriptive segments for the event (category, action, and label). Sites that use Universal Analytics sites use different JavaScript functions than sites that use the traditional ga.js - for more information, see the "About Events" help article.

3) Use a Virtual Pageview to Track Downloads
Each time a visitor clicks a link to download a file, a pageview will be sent to Google Analytics and the downloaded file will appear in the Content reports. For more information, see the "Syntax Comparisons" help article.

Tracking Direct File Downloads & Hotlinked Images

The previous examples assume a visitor clicks a link on your site to download a file. But when a document is directly linked from another site, Google Analytics isn't able to track the download because the tracking code doesn't run. This applies to files that are directly linked from a blog, a search engine, an email, or any website.

Here's an example: go to google.com and search for "form 1040" (or click the following link):

http://www.google.com/#q=form+1040

The top search result links directly to a PDF on the IRS.gov website. If you click the search result, you'll load the PDF directly in your browser and bypass any JavaScript-based tracking.

The same thing happens if you click this link:

http://www.irs.gov/pub/irs-pdf/f1040.pdf

The IRS website uses Google Analytics, and they won't be able to track these clicks because the PDF files are accessed directly.

So how can you track direct file downloads?

We recommend using Angelfish Software, which has a utility that automatically uploads this information to your Google Analytics account. Angelfish shows you direct links to files on your site AND the websites that link directly to them.

Angelfish also shows you hotlinked images. A hotlinked image is an image file on your site (like a jpg or gif) that is referenced in the html of a page on another website. When the page on the other website loads, your web server delivers the image. In a sense, the other website is stealing your bandwidth.

Learn more about Angelfish Software at:
http://analytics.angelfishstats.com