A lot of our clients have valuable PDF content on their website and it is important for them to understand how often this content is being downloaded. Whilst Google Analytics 4 is able to track downloads and PDF link clicks thanks to Enhanced Measurement, Google Analytics Universal requires some configuration first, using Google Tag Manager. Because of this additional work required, it is often overlooked by marketers. However, as with all types of content, understanding which downloadable content is more engaging will tell you where you should be focusing your effort more.
In this blog post, we are going to run through the steps of how to measure PDF downloads using Google Tag Manager.
A recap: Google Tag Manager in a nutshell
We wrote a blog last year, which explained what Google Tag Manager is, and the benefits it offers, but briefly put, Google Tag Manager software allows you to deploy marketing tags, which are small segments of JavaScript or tracking pixels, onto your website without needing to actually change the code manually.
Phase 1 - Setting up your Trigger
So the first thing you need to do is to log in to your Google Tag Manager account and locate the Triggers tab on the left-hand side.
Now that you are in the trigger section, you need to select a new trigger, click 'Trigger Configuration', and choose 'Just Link Clicks'. The firing trigger setting needs to be 'Select Some Link Clicks' as you don't want to track all link clicks, just those that are PDFs. Once you have selected that, enter the following condition: 'Click URL contains .pdf'. Now you can save the trigger.
Phase 2 - Creating your Tag
Now that the trigger has been set up and saved, it is time to move on to your Tag. This is the part that takes the information of a PDF link click and showcases it in your Google Analytics as an event.
To set up your tag, select new tag and give it a name - in this example, we have called it Event - PDF Clicks. Then, set your 'Track Type' to Event, use PDF download as the category (this can be whatever you want to name it, this is just what we chose). In the 'Action' section, select {{Click URL}}, have the 'Label' section as {{Page URL}}, value can be left blank and you can leave 'Non-Interaction Hit' as false. Then select the Google Analytics Settings Variable in the 'Settings' field (you should have created this setting when you first set up tag manager). If you haven't set this up before or are completely new to Tag Manager, you can follow this Google Guide that will take you through the steps to do it.
For the 'Firing Trigger' section, you need to select the Just Link Clicks trigger that you created in phase 1. And then just save the tag!
Phase 3 - Testing
Now that the tag and trigger have been saved, the important thing to do is to test and make sure everything has been set up correctly and the tag fires according to plan.
To do this, we need to load up the enable the preview and debug mode, by clicking the Preview button that can be found in the top right corner. Enter the web URL of a page that you know has a PDF link, and start the preview.
As you can see from the image above, our web page with a PDF link has loaded up and the Tag Assistant has connected. Now that the Assistant has connected, I need to click on the PDF link (in this example, it's the link 'Download our Job Description here'), which if all set up correctly will cause the Tag to fire.
After clicking the link, you need to go back to the preview screen in Google Tag Manager to discover if the tag is firing as expected. As you can see from the image below, after clicking the link on the page, the 'Event - PDF Clicks' Tag has successfully fired!
And there you have it - you've successfully created a Tag & Trigger for tracking PDF downloads AND made sure it works as it should! Now that you have tested it and are happy with the functionality, all that is left for you to do is to submit and publish your container in order to push it to your live website.
Head back into your Google Tag Manager workspace, and click Submit in the top right corner. Give the container a name (e.g. PDF download tracking) and click publish. Now, your newly created tag is live and will track your PDF downloads going forward!
Marketing Made Easy
As you can see, Google Tag Manager is a really powerful tool to use alongside Google Analytics that will provide you with insightful data that can shape your digital marketing activities.
If you need help setting up Google Tags or want to explore some more of our digital marketing services, then why not drop us a message and let's start a conversation.