Friday, December 18, 2009

How To Track PDF Downloads in Google Analytics

Google Analytics is an excellent tool for tracking all types of site visitor interaction. But two common questions we receive from clients interested in tracking their site's activity include:

I) Why doesn't Google Analytics track PDF* downloads on my site?
II) How can I make Google Analytics track PDF* downloads on my site?

Read on to find the answers to both of these questions.

I) Why doesn't Google Analytics track PDF downloads on my site?

Google Analytics updates it's data every time a page on your site loads its tracking code. If a page on your site does not contain the Google Analytics tracking code, that page is essentially invisible to Google Analytics. Because the PDFs that you are linking to do not contain Google Analytics tracking code installed on them, they are invisible to Google Analytics. (This is the same reason why links hosted on your site and pointing to other websites are not tracked, since the landing page of the other websites do not contain your Google Analytics tracking code.)

II) How can I make Google Analytics track PDF downloads on my site?

Fortunately for us, Google Analytics has created a work-around for tracking activity to destinations (URLs or documents) that do not contain your tracking code. Essentially, it is a means of faking or "simulating" a page load at the link click level (rather than the page load level). In this way, you can tell Google Analytics to update its data whenever your tagged link is clicked, regardless of whether or not the destination contains tracking code or even loads in full. You can accomplish this by performing the following:

Once you've created a link to your PDF, you'll need to edit the Source Code (HTML). To do this using the Evergreen CMS, you'll need to click the [<>] button located within the second row of the WYSIWYG ribbon menu. Locate the line of code that denotes your hyperlink.

eg.


You'll simply want to edit this link to match the following format:

eg.


Apart from the URL pointing to your PDF (in this example: http://www.mydomain.com/assets/documents/my-document.pdf) the only other part to this code which will change with each link you tag is the actual name you assign to the link (eg. /downloads/document-name). For example, you could name it /downloads/Calendar-2010.doc or simply Registration Dates. This part of the code is entirely up to you, just know that whatever you choose to name it will dictate how it shows up in your Google Analytics reports.

We hope this guide was helpful in not only giving you the tools to track your site's PDF downloads, but also in providing you with some of the logic behind it.

* The PDF filetype is used in this article simply because of its popularity among our clients, however this guide applies to ANY filetype that can be linked to on a website and downloaded by a visitor (eg. .doc, .xls, .zip, etc.)

No comments:

Post a Comment