How to Track PDF Views in Google Analytics

Google Analytics Logo

When a visitor uses your website to inform their purchasing decisions, they leave behind a trial of evidence showing what content they consumed, and engaged with, along the way - page visits, site search, bounce-rate, etc. While each crumb tells a story, certain actions are more valuable because they signal an intent to eventually buy. The high-value interactions fall into two main categories:

  • Micro-conversions - smaller actions that indicated interest in a product/service (watching a video, downloading a brochure, using a cost-calculator)
  • Macro-conversions - large goals that show intent-to-buy (submitting a quote request, adding an item to a cart, calling a sales rep)

Macro-conversions are easy to measure because they are almost always associated with an exchange of information; an email to a rep, a credit card number, a form submission. In contrast, micro-conversions usually just involve a click or two, so they often go untracked. It can takes weeks or months of research before potential customers complete a macro-conversion, so manufacturers need to measure micro-conversions in order to properly determine the short-term effectiveness of their digital marketing and web content.

PDF views are the first micro-conversion manufacturers should measure, since PDFs contain loads of valuable technical/implementation information and visitors that download literature represent more-qualified traffic than those who do not. However, Google Analytics does not track PDF views like a typical page view, so measuring 'PDF downloads" requires a bit of a work around.

Step One: Install Google Tag Manager

In the simplest sense, Google Tag Manager allows you to add little flags to your website that say, "Hey, I'm important, measure me" to analytics software (like Google Analytics). The flags can be associated with almost any element - buttons, time on a page, clicks - all you need to do is write the script.

The video below describes how to install Google Tag Manager, as well as an introduction to the software (written instructions can be found here - https://support.google.com/tagmanager/answer/25743...).

There are three main components of GTM:

Rule - A name given to a condition or set of conditions
Tag - Triggers an event when a rule is met
Container - the "box" that holds all your rules and tags


Step Two: Create a "Link Click Listener" Tag

Before you can measure PDF views, you need to first ensure that anytime someone clicks a link on your website, that click is tracked: a Link Click Listener tag accomplishes this.

  1. In your Container Overview menu click New --> Tag and name the tag "link click listener"
  2. Under "Tag Type" select Event Listener --> Link Click Listener
  3. On the right hand side of the screen, click +Add next to "Firing Rules" and select "All pages" (Google Tag Manager creates the "All pages" rule automatically).
  4. Save

This creates a tag that says, via code, "On all pages of this website, whenever someone clicks on a linked element, I will create an event called gtm.linkClick."

Link Click Listener


Step Three: Create a Rule to Identify PDF Clicks

Now that you're measuring all link clicks on your website, you need to hone in PDF clicks specifically, which means creating a new rule.

  1. In your Container Overview menu click New --> Rule and name the rule "PDF click"
  2. Under "Conditions" select {{event}} --> equals --> gtm.linkClick. Remember, that gtm.linkClick is the item generated by your Link Click Listener tag
  3. Add another condition - {{element url}} --> contains --> .pdf.
  4. Save

This creates a rule that is only met when someone clicks on a link with .pdf in the url string.

pdf-click

Step Four: Create a "PDF View" Tag

This tag will add an event to your Google Analytics account anytime someone clicks on a PDF.

  1. In your Container Overview menu click New --> Tag and name the tag "Analytics Event - PDF View"
  2. Select "Tag Type" Google Analytics --> Universal Analytics (or classic if you haven't upgraded).
  3. Add your Google Analytics tracking ID to the "Tracking ID" box.
  4. Under "Track Type" select Event
  5. In the "Event Tracking Parameters" assign the following names (these will help organize events within Google Analytics as you add more tags):
    Category - micro-conversion
    Action - {{element url}}
    Label - pdf-view
  6. Click +Add next to "Firing Rules" and select "pdf click"
  7. Save

analytics-event

Step Five: Test Your Tags

  1. In the upper-right corner of your Container Overview menu click Preview --> Debug
  2. Visit your website in a new tab
  3. Click on a PDF on your website
  4. If the menu bar below reads "Tags Fired on this Page: Analytics Event - PDF View," then you're set. If not, go back and look for mistakes, a single typo or space can break firing process.
  5. Exit debug mode.

Screen-Shot-2014-12-30-at-12.48.16-PM.pn

Step Six: Create a "PDF View" Goal in Google Analytics

  1. In your Google Analytics account, select "Admin" from the primary navigation.
  2. Select the property (whose tracking code you used in GTM during step four) and the view you want to create the goal in.
  3. Click Goal --> New Goal, name the goal "PDF View" and select event under the "Type" menu. Click next.
  4. Under "Event Conditions" set category --> equals to --> "micro-conversion" and label --> equals to --> "pdf-view"
  5. Save.

pdf-goal

You can now track PDF views as a goal within this Google Analytics view. If you would like to see the full report on your Tag Manager events, click on the Behavior --> Events --> Overview report in the sidebar of Google Analytics. The Event Action report will show you the exact URLs of the downloaded PDFs.