Track PDF downloads with Google Tag Manager

March 19, 2014

Tracking PDF downloads is one way to measure conversions, or at least micro-conversions, that identify interest on your website. I’ve tried other methods’ I’ve fond on blogs with no luck, and have seen some posts that get into custom code, which shouldn’t be necessary. Here’s how to track PDF downloads with Google Tag Manager.

1. Tag Manager tracking setup

This method will let you automatically track PDF downloads (technically clicks on the PDF which could be an open and/or a download) across your whole site, and report them back to you with this easy one-time setup.

First, make sure you’ve got a click listener set up in Tag Manager. Under the Tag Type dropdown menu, select Event Listener then Link Click Listener. Then set a firing rule for All Pages, which should already exist by default.

 google tag manager link click listener

Now create a new tag for tracking the PDF downloads. Be sure to select the correct tag type for your Google Analytics setup, and enter your tracking ID (here’s a quick macro shortcut for Google Tag Manager for saving your ID).

google tag manager track pdf download

2. PDF click tracking rule

Next, set up a rule like the following which essentially says, “record a click on any URL that ends with pdf.

google tag manager pdf download rule

3. PDF download reporting

Finally, set up the parameters to record your PDF downloads as events in Google Analytics. Structure this however you like for your own organization – the important part is the {{element url}} macro, which will print out the exact URL including the filename of the PDF that was clicked.

google tag manager track pdf download parameters

If you want, you could set up a goal that tracks any event category matching PDF, or you can simply view these downloads in your Events section of Google Analytics.

The same method can be used to track clicks on other types of files, like images, by creating an identical rules and renaming “pdf” to “jpg”, “png” etc.

Wow, when I set out to write this I thought it’d be a lot shorter. Google Tag Manager’s auto-event tracking can be difficult. Having trouble with this or other GTM issues? See my post on debugging Google Tag Manager auto-event tracking for some step by step tips that may help you out.



Follow @porcelainduck
Subscribe to RSS