How to track PDF documents being downloaded?
A lot of websites today include PDF documents for visitors to download. It would be nice to know how many people actually are downloading those documents. With Google Analyics it is possible to track downloads and see them results in your Google Analytics reports.
All you need to do is add some Javascript code to your hyperlinks and be sure your main Google Analytics urchinTracker() tracking code is placed near the top of your source HTML code, but not about your <body> tag. Inside your anchor tag (the hyperlink) include the following:
<a href=”http://www.yourwebsite.com/files/filename.pdf” onClick=”javascript:urchinTracker (‘/pdfdownloads/filename‘); “>
Now every time someone clicks and downloads the pdf file it will appear in Google Analytics as a page with the name: /pdfdownloads/filename along with the number of clicks . You can use what ever name you want too to help you identify it in your Google Analytic reports. If you have several different PDF documents for users to download… no problem! Just give each on a unique name for tracking. For example using the above: “/pdfdownloads/filename1″, “/pdfdownloads/filename2″, “/pdfdownloads/filename3″, etc…
You could also try this out with external websites that you link too to see how many visitors click on the various outbound links and which are the most popular.
For more information about this see the Google Analytics download tracking help page.
Similar posts you might be interested in reading:


Comments