Track PDF Downloads in Google Tag Manager

There are a few ways to track PDF Downloads in Google Tag Manager. However, for this example, I would like to use a click listener method. We will generate an event each time someone clicks a PDF link. Tracking the actual download isn’t necessary because many people will simply view the PDF file  in the browser.

Click the link the below to see how a PDF is displayed the browser.

TEST

First you will need to Open up Google Tag Manager and create a trigger and tag.  We will use Google Analytics as our tracking platform. However, please feel free to use others.  Lets get started with the Tag creation.

Create a Google Analytics Tag

  1. Choose Tag, Choose New
  2.  Name Your Tag
  3. Choose Google Analytics Tag, Use Universal Analytics
  4. For Track Type, Choose Event
  5.  Name Your Event Category and Action 
  6. For Label Choose Page Path or Page URL to know how users reach the pdf.
  7. For the moment, leave Fire On blank, we will create a trigger to add to the tag.
  8. Create the Tag

 Track PDF downloads with Google Tag Manager Universal
The next step is to create a trigger that will tell the tag to fire each time our PDF download link is clicked.

  1. Choose Triggers
  2. Click New
  3. Name your Trigger
  4.  For Event, Choose Click
  5.  Configure the Trigger by choosing, Just Links for targets
  6.  Leave the standards settings of Wait for Tags & Max Time to Wait
  7.  Under Enable When, you want to enable this on all pages by choosing Page URL contains (.*)   If you want to track on a specific URL please indicate.
  8.  For Fire On, chose the Click URL, since you know this is a PDF, we can use the \.pdf$ to indicate that we only want to track PDFs.
Use a trigger to fire an event for PDF dowloads

Use a trigger to fire an event for PDF dowloads

Attach the Trigger to the Tag. 

  1. Open up your previously created PDF download tag, under Fire ON, choose Click.
  2.  Add the trigger that you previously made to the Tag and Save.

Test Functionality

  1. Click Preview and Debug Mode
  2.  Go to your website and click the PDF download link
  3. See if the Tag is fire in the Debug Console.