How to track PDF downloads in Google Analytics using Google Tag Manager

We can’t track PDF document views in Google Analytics but this doesn’t mean we can’t track when users download them from our site. By doing so, we’ll get to know if users at least downloaded our PDF files and if they did, for how many times and from which page.

This is not the same as knowing if users actually read the document, but it’s still better than not knowing anything at all about the PDF documents usage.

Implementing the Google Analytics PDF download tracking is super easy with Google Tag Manager (you don’t have to be a Google Tag Manager expert for this) so in this tutorial, we will use this method to implement the tracking.

You don’t have to be a Google Tag Manager expert to implement PDF download tracking in Google Analytics Click To Tweet

Creating the GTM tag

Since we are going to track the PDF downloads as events in Google Analytics, we need to create an Event type tag in Google Tag Manager. In the event category field, we can write “PDF downloads”, in the event action we will add the “Click URL” built-in variable and in the event label we will add the “Page Path” built-in variable.

In this way, when the event will be sent to Google Analytics, the event category will be “PDF downloads”, event action will be the PDF file’s filename and the event label will be the page path where the user downloaded the document.

After configuring the tag, we can name it as “GA – Event – PDF Download tracking” and select our GA settings variable in the “Google Analytics Settings” field.

gtm tag for event pdf download click tracking

Creating the tag trigger

Now that we have our tag ready, we need to add a trigger to it which should fire when a user clicks on a link with a PDF extension. For this, when creating the trigger, we should choose a “Click – Just Links” trigger type and as a condition, we should set it to fire when the “Click URL” variable ends with “.pdf”.

PDF download click trigger

Once created, we need to assign this trigger to the tag created earlier and test it.

pdf download trigger tag

Testing the PDF download tracking

The first thing to do when testing the tag is to enable the “Preview and debug” mode in GTM by clicking on the “Preview” button from the top right corner.
preview GTM

After this, we can open a page on our site where there is a link to download a PDF file and click on it. If the tracking was installed correctly, we should see the tag “GA – Event – PDF Download tracking” fire in the “Preview and debug” console that loaded on the page.

pdf download tag gtm

And to confirm that the event was truly sent to Google Analytics, we should check the “Events” section from Google Analytics’s “Real Time” report, where our event should show up.

PDF download event in real-time report google analytics

Creating a goal in Google Analytics

Depending on what you are measuring as a conversion, you might want to create a goal if a specific PDF document is downloaded. In this way, you will know which traffic source or campaign generates more PDF downloads and which one is performing worse for this purpose.

To create a goal, in the Admin section from Google Analytics, we need to go to View/Goals and click on “New Goal”. As the goal type we need to select “Event” and on the next step, in “Event Category” field, we should enter “PDF downloads” while in the event action field, you need to enter the path of the PDF document you want to track. In this example I left it blank as I want this goal to track all PDF downloads.

goal pdf download

With this goal, your PDF download tracking should be ready so the only thing remained to do is to publish the changes in GTM.

Now you can start analyzing the newly collected data in the Events reports from your Google Analytics account or you could use a tool like KPIBees to import the data in Google Spreadsheet for a more granular analysis.

If you have any question regarding this tracking, ask us it in the comments below. Alternatively, if you need help with other Google Tag Manager or Google Analytics task, you can send us a message and our experts will help you with your task/question.

4 Comments Leave a reply

  1. Google Tag Manager is an excellent resource. It’s not simple to get started with, however, so this is a very useful guide. Thanks for sharing. This really simplifies things and allows those who are unfamiliar with Tag Manager to really benefit from this valuable resource.

    0

    0
    1. You’re welcome Anthony!
      Indeed, GTM can seem complicated at first, but with time and some practice it gets easier and easier to deploy tags and tracking using it.

      0

      0
    1. If you are referring to embedding the PDF document in a dedicated landing page, then yes, this should be good. And since each time a user goes to that landing page, the PDF file is displayed, you could count pageviews to that landing page as views of the PDF document.

      0

      0

Leave a Reply

Thanks for choosing to leave a comment. Please keep in mind that comments are moderated and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.