Back to List

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

Melanie Lenaghan Melanie Lenaghan  |  
Jan 23, 2017
Many websites offer marketing resources such as whitepapers or reports to be downloaded. These resources often come in the form of a PDF.  In many cases, it is helpful from a marketer’s point of view to track these downloads. They can make marketing decisions based off interest in the resource’s content. Google Analytics tracks page views through a tracking pixel on an HTML page. Tracking a PDF download works a bit differently since a PDF file cannot request a tracking pixel. Luckily, with the help of Google Tag Manager there is an easy way to track this information. Once you get logged into Google Tag Manager you can follow these steps.
Step 1: Install Google Tag Manager on your website
  1. Click on ‘Admin’ in the main navigation
  2. Click on ‘Install Google Tag Manager’
  3. Copy the provided code and paste in the <head> and <body>
Step 2:  Enable pre-built variable for clicks.
  1. Click on ‘Variables’ in the left panel navigation
  2. Click ‘Configure’ under the ‘Built-In Variables’ section
  3. Ensure ‘Click URL’ is checked under the ‘Clicks’ section

Step 3: Create a Tag and Trigger
  1. Click on ‘Tags’ in the left panel navigation
  2. Click ‘NEW’ and name tag appropriately
  3. Configure your tag by clicking the edit pencil icon in the ‘Tag Configuration’ section
    1. Choose ‘Universal Analytics’ as your tag type
    2. Tracking ID (tracking ID from Google Analytics account): UA-xxxxxx-xx
    3. Tracking Type: Event
    4. Event Tracking Parameters –
      1. Category (Category you would like your action organized under): Resource Download
      2. Action (The action of the event itself): Download of PDF
      3. Label (detailed information on the event): {{Click Text}}
    5. Your tag configuration will resemble this: 
  1. Create the trigger by clicking the edit pencil icon in the ‘Triggering’ section
    1. Click ‘+’ (New) to create your trigger and name appropriately
    2. Configure the trigger by clicking the edit pencil icon in the ‘Trigger Configuration’ section
      1. Choose ‘Just Links’ as your trigger type under the ‘Click’ section
      2. This trigger fires on: Some Link Clicks
      3. Setup your rule with the dropdowns and text fields: ‘click URL’ ‘contains’ ‘.pdf’
      4. Save the trigger
      5. Your trigger configuration will resemble this:

  1. Save the tag
Step 4: Publish
  1. Click the ‘Publish’ button in the top right to publish your event
Now that your click event is setup you can test to ensure it is working properly. Open two windows in your browser. One for your live site and the other for your Google Analytics account. Click on the PDF download on your live site to trigger the event. Navigate to the Google Analytics window and click on ‘Real time events’. Here you will see the event tracking analytics.

Hopefully these instructions will be helpful for your marketing efforts. If you have any questions or would like additional information, you can either leave a comment below or contact us directly through the contact section.


Love our Blogs?

Sign up to get notified of new Skyline posts.


This was a clear, step-by-step and a huge help Melanie, thanks. I wanted to track PDF and DOC and my first run through I added both to my trigger. After a couple of days I checked the data and nothing. After looking closely at the trigger I noticed that it is an AND condition that must be satisfied. So I simply created three separate triggers (DOC, PDF, DOCx) and added them to the tag and the data is spooling into Real-Time view. I first tried to add a variable to Value:{{Click URL}} - but nothing spooled in and a little digging turned up that it is not used in that way.
10/20/2017 3:23:13 PM

Jared Newnam
Will this address tracking PDFs that are placed in my Twitter feed, and then clicked on and downloaded. My users are not clicking on these PDFs from my website. They are clicking on them from a Tweet. Thanks.
4/20/2017 9:12:32 PM