How to Track PDF Downloads in Google Analytics

How to Track PDF Downloads in Google Analytics

We’re as big an advocate of data-based marketing as anybody out there. In order to make informed marketing decisions, it’s important to track more than what a basic Google Analytics setup will give you. While a basic setup will give you a lot of data about how people are interacting with the pages on your, one thing that isn’t tracked is PDF downloads. Google Analytics only tracks data for website pages that load their script, but we can change that.

Did you know that with a combination of Analytics and Google Tag Manager it’s possible to track the engagement of almost any element on your website? This includes tracking clicks on files such as PDF documents that occur on your website or a certain web page. Download tracking analytics are important because they allow you to see whether the resources you’re offering are of use to your visitors.

If you want to move beyond basic page view tracking on your website, downloads like PDFs are a good place to start.

Download Tracking Using Google Tag Manager

Before you get started tracking downloads you’ll need to make sure you have Google Tag Manager set up on your site. Then you’re going to create a new tag and trigger set.

Step 1: Set Up Tag Manager Variables

The first thing we’ll do is get into Google Tag Manager (GTM). We’re going to ensure that the click variables we need are enabled and also set up a Google Analytics settings variable.

  1. In GTM, navigate to the Variables section.
  2. The top part of the Variable section is for Built-In Variables. In this section click the Configure button.
  3. In the menu that opens; scroll down and check:
    1. Page URL
    2. Page Path
    3. Click URL
  4. Next, you’ll want to create a user-defined variable to connect your Analytics account.
  5. In the User-Defined Variables section, click on the New button
  6. Name the variable GA – Settings
  7. For the variable type, scroll down to Utilities section and select Google Analytics Settings
  8. For the Tracking ID, enter the tracking ID from your Google Analytics property
  9. Click Save

Google Analytics GTM Settings

Step 2: Create a Trigger

In Google Tag Manager you’ll need to get up a new trigger to indicate when a PDF was clicked so that the tag can be sent to Google Analytics.

  1. Click on Triggers in the left-hand menu and then click on the New button.
  2. Name the new trigger PDF Click and click in the Configuration box to set it up
  3. Choose Click – Just Links as your trigger type
  4. In the configuration box check both checkboxes
  5. Enable the trigger for all pages
    Page URL matches RegEx .*
  6. Select the Some Link Clicks radio button
  7. Fire the trigger when Click URL contains .pdf
  8. Save the trigger

Note: This will fire on clicks on any link on your site that contains .pdf in it. If you would like to restrict this to only track for PDFs that are located on your website (not external files), you’ll add a second condition. Click on the + next to your first condition (url contains .pdf) and choose ‘Click Text’ from the first dropdown, ‘contains’ from the second and then put your site url into the last box.

How to Track Downloads in Google Analytics Step 3: Create a Tag

  1. Click on Tags in the left-hand menu and then click on the New button.
  2. Name the new tag PDF Click Event and click in the Configuration box to set it up
  3. Select Universal Analytics as your tag type
  4. For track type, choose Event
  5. Category: PDF Links
    Action: {{Click URL}}
    Path: {{Page Path}}
  6. Under Google Analytics settings, choose your existing GA settings variable
  7. Save the tag

How to Track Downloads in Google Analytics Step 4: Publish Your Changes

In order to have your new tracking start collecting data on your website, you’ll need to publish your updated container. To do this, click on the blue Submit button in the upper right corner of any page.

You’ll be asked to add a descriptive name and description. While this is optional, it’s a good idea to briefly detail the changes you made in case you need to refer back to the timing of events.

Click the blue Publish button in the top right corner to complete.

You’ve now completed setting up how to track PDF downloads on your site from your website visitors. After publishing your changes you’ll soon see real-time data start to populate in Google Analytics events. You can now use these events in dashboards and to set up download conversion goals.

If you have any questions about phone call tracking in Google Analytics, please get in touch.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.