Mobile app version of vmapp.org
Login or Join
Sarah324

: Tracking PDFs properly on our website I'm looking for the proper way to track pdf downloads from both emails and our site links. If I have many pdfs on a single page, how do I track the

@Sarah324

Posted in: #GoogleAnalytics #Pdf #Tracking

I'm looking for the proper way to track pdf downloads from both emails and our site links.

If I have many pdfs on a single page, how do I track the pdf downloaded? I found an article on Moz explaining to add "&PDF=name of pdf" to the link as a way. How does this affect bounce rate and other measures? If a user lands on a page and clicks a PDF on that page in less than 30 secs is that a bounce?

Also email tracking links to PDFs. What is the best way to track those links? They would never be considered a session if they never hit the analytics code. Thanks all!

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Sarah324

3 Comments

Sorted by latest first Latest Oldest Best

 

@Kaufman445

You should also consider server side statistics to gather data like accesses to files. You can install a system on your server which will analyse the server log files.

For example Webalizer www.webalizer.org/

10% popularity Vote Up Vote Down


 

@Shakeerah822

I believe that a better way to track PDF’s, and other file downloads, is to create a mechanism to take advantage of the Google Analytics Measurement Protocol. It would allow you to track when the file was actually accessed from your server instead of when a buttonlink was clicked.

The con of this approach is of course creating the mechanism to handle the HTTP Request to Google Analytics and then returning the file to the user without affecting their experience on your site.

Here is a high level view of how I handle files:


Someone navigates to example.com/example-file.pdf The webserver rewrites the URL to example.com/file-handler/example-file.pdf. The rewrite means that the user’s browser still shows example.com/example-file.pdf in their address bar.
The file-handler determines if the file actually exists either on the webserver or in a database
The file-handler makes an HTTP Post to ssl.google-analytics.com/collect with this data:
v=1 // Version.
&tid=UA-XXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t=pageview // Pageview hit type.
&dh=example.com // Document hostname.
&dp=/example-file.pdf // Page. (The URL path that the user used to access the file)
&dt=Example File // Title. (The file name or make a custom title)
Clear the response
Change the response content type to 'application/pdf'
Add the header so the browser knows that you are sending it a file
Display the file to the user.


Within Google Analytics I can report on files the same way that I can any webpage. The Measurement Protocol also has the ability to fire events and associate calls to a campaign.

If you have any questions let me know, and I hope that helps.

10% popularity Vote Up Vote Down


 

@Odierno851

If I have many pdfs on a single page, how do I track the pdf downloaded?

If your goal is to track PDF's based on type or subject then you can add even tracking code to each one and it will show up under your Behavior -> Events report in GA. This could get very tedious and really depends on how many PDF's we are talking about. Your code will look something like this:

<a href="#" onClick="_gaq.push(['_trackEvent', 'Downloads', 'PDF', 'PDF Title Goes here']);">Download PDF</a>


If you use Google Tag Magager there are a few other options that you can you utilize. Using even triggers, listeners and HTML5 data parameters. Check out this article on how to use GTM to track downloads.

If you have a ton of PDF's I would recommend a more automated tracking with GTM.

How does this affect bounce rate and other measures? If a user lands on a page and clicks a PDF on that page in less than 30 secs is that a bounce?

If you set this event to non-interaction = False then it will lower your bounce rate because the action/interaction it will be added to the bounce rate calculation.

Also email tracking links to PDFs. What is the best way to track those links?

For email you can use campaign tracking code within your links. You will be able to find them under your Acquisition -> Campaigns report. This will not count it as a sessions unless your link is to a page where the PDF is located. Code would look something like this:

domain.com/?utm_source=Email&utm_medium=Newsletter&utm_term=PDF%20Link&utm_campaign=My%20Weekly%20Newsletter


If you want, you could actually track both email and website PDF downloads using campaign code. That way you could have everything under one report. Just change the Source parameter value to Email or Website or something.

Lastly, whatever you will end up doing, make sure to think long and hard about how you label your events and campaigns. You want this to be well organized so its easy for you to see the whole picture and add sub evens and campaigns under the same report.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme