How to Track PDF Downloads using Google Tag Manager

how to track pdf downloads using google tag manager

PDF downloads are one of the most common conversion methods for websites. Some samples would be businesses allowing users to download their company brochures or product catalogs and education websites that have educational materials for download.

You may be able to track the total number of downloads a PDF file gets by using a plugin but it doesn’t really tell you anything. Any piece of data is important if you want more people to download your PDF files from your website. Luckily, Google Tag Manager makes it easier for webmasters to track PDF downloads across their websites and collect data using Google Analytics.

Before you set up the tag to track PDF downloads, make sure that you’ve already set up Google Analytics page views tracking in your Google Tag Manager. If not, then I highly recommend that you go through that first before moving forward with this guide.

Setting up the Tag

Go to your Google Tag Manager dashboard, click Tags, then click new to start the setup. I named the tag PDF Download but you can name yours depending on your preferences.

Click Tag Configuration and select Google Analytics. It should be the first one on the list.

google tag manager tag configuration

For Track Type select Event. This means that all PDF downloads will be recorded under Events in Google Analytics.

For the Event Tracking Parameters, you can customize however you want. In this example, I simply labeled Category as Download, Action as PDF Download, and I used the built-in variable {{Click URL}} for the Label meaning Google will automatically use the URL to label the PDF file that was downloaded.

You can use the other built-in variables and Google will automatically label the events for you but personally, I’d rather customize it cause letting Google label them automatically can get messy.

Value is optional. If your PDF downloads have a monetary value for you, then you can add it here.

This should how your setup should look like:

google tag manager pdf download tag setup

You can explore the additional options but I recommend that you don’t if you’re not quite familiar with them. 

Create the Trigger

After you’ve set up the tag, we’ll now select where the tag is going to trigger. Scroll down and you should see the option to set up a trigger.

Click the Plus button to create a new trigger. Name your trigger then click Trigger Configuration. Select Just Links under Click.

Under This trigger fires on, select Some Link Clicks, and choose Click URL. Now, you have two options here. If you select contains or ends with then just place pdf, the tag will track ALL PDF downloads. However, if you want to track a specific PDF file, then you should select equals and put the URL of the specific PDF file you want to track.

Your setup should look like this now:

google tag manager pdf download trigger

Click Save on the trigger settings and Save your tag settings.

Test it on Preview Mode

At this point, don’t submit your changes immediately. I highly recommend that you use Google Tag Manager’s Preview Mode all the time when testing out new tracking tags on your website.

google tag manager preview mode

Go to Preview Mode and refresh your website. You should now see Google Tag Manager’s Preview mode on your website. Go to the page where the PDF file is available for download. Click the link or button and the Preview Mode should show that the tag you created was triggered.

google tag manager pdf download preview mode trigger successful

If you encountered no problems at all, that’s it! You can now publish the changes you’ve made.

Setup Goals in Google Analytics [Optional]

If you consider PDF files as conversions, you can now set them as Goal completions in Google Analytics. This is optional and this is not required.

Go to Goals, select Download or Print as the template, name the Goal, and select Event.

For the Goal details, use the name that you used for Category and Action in Google Tag Manager. 

As for the Label, since I set it as {{Click URL}}, Google Analytics will use the URL of the PDF file as the Label of the event. If you want to set a Goal for a specific or single PDF file, use the Equals to option and input the exact URL of the PDF file you want to track in Label.

If you want to track all PDF files in the same goal, select Regular Expression which is more flexible. I set this to *.pdf. The wildcard means that Google will count any file download as a Goal completion as long as it ends with .pdf.

pdf download goal tracking google analytics

Check your Data in Google Analytics

Once you’ve saved the changes you’ve made in Google Tag Manager, all PDF downloads should be tracked immediately and you should start seeing some data in Google Analytics. You should see them by going to Behavior and clicking Events.

Aside from just knowing how many people downloaded PDF files from your website, you should be able to see much more data that you could use to optimize your campaigns. You’ll be able to collect data such as the number of downloads per day, pages user viewed before downloading, location, device, and more.

All these data are crucial for conversion rate optimization. I highly recommend that you do A/B testing to find out how you could further improve the number of PDF downloads in your website. Good luck!

Share on:
Sean Si

About Sean

is a Filipino motivational speaker and a Leadership Speaker in the Philippines. He is the head honcho and editor-in-chief of SEO Hacker. He does SEO Services for companies in the Philippines and Abroad. Connect with him at Facebook, LinkedIn or Twitter. He’s also the founder of Sigil Digital Marketing. Check out his new project, Aquascape Philippines.