How to track pdf downloads google analytics - opinion
How to Track PDF Downloads With Google Tag Manager
If you have a number of PDF resources on your website, chances are youre going to want to track downloads of these. Using Google Tag Manager makes tracking setup a breeze.
By using Google Tag Managers variables, we can create one tag to rule them all, passing the specific PDF name dynamically based on the content downloaded.
In this article were going to run through how to track PDF downloads using Google Tag Manager and how to set this as a conversion in Google Analytics, Google Ads, Facebook Ads, Linkedin Ads and Twitter Ads.
PDF Tracking in Google Tag Manager
Create Your Trigger
- From the Triggers menu select New
- Give your trigger a descriptive name, weve gone for PDF Download Tracker
- Select the trigger Click > All Elements
- Under This trigger fires on select Some Clicks
- Select Click URL from the variable drop down
- Select Ends With from the match type dropdown
- Specify .pdf in the value field
The resulting Trigger should look a little like this:
This trigger will fire when the clicked elements links to a URL ending in .pdf
For the Trigger, our work here is done. When added to a tag this trigger will fire when the URL of a clicked element ends in .pdf. This will work if you are linking to PDFs from text, images or buttons.
Track PDF Downloads in Google Analytics
- From the Tags menu select New
- Give your tag a descriptive name, weve opted for GA PDF Download
- Select the Google Analytics: Universal Analytics tag
- Select Event as your track type
- Set your Category and Action names these can be anything of your choosing
- Set the Label to the {{Click URL}} variable by selecting the building block icon
- Under Triggering, select the trigger we created earlier and save
- To push live, hit Submit, provide some details about the changes you made in this version and press Publish
Some notes on getting the most out of your data. When it comes to Event Category and Action, set values that make sense for your Google Analytics setup and your businesses website.
For example: weve opted for Resource and PDF Download as we have other resource types such as videos and scripts that wed like to be categorised under the Resource banner.
Weve chosen to set the label, the lowest and most specific level of Google Analytics Event hierarchy, to the Click URL variable. This will pass the URL of the PDF into Google Analytics, allowing you to see the exact file accessed.
Remember if youd like to set this PDF analytics tracking as a goal also, you can do so by setting the exact Event Category and Action you have above and leaving Label blank.
Tracking PDFs in Google Analytics
Track PDF Downloads in Google Ads
- From the Tags menu select New
- Give your tag a descriptive name, weve opted for GAds PDF Download
- Select the Google Ads Conversion Tracking tag
- Next we need to navigate to the Google Ads account in question
- Select Tools & Settings from the header bar and then Conversions under the measurement section
- Click the blue + icon
- Select Website conversions
- Select a conversion category, weve chosen Other
- Name your conversion, we chose PDF Download
- Select Use the same value and insert the value a PDF download is worth, or, select Dont use a value
- Chose your count options, if youd like to track every time a PDF is downloaded following a paid click select Every
- If youd like to track one conversion (PDF download) per paid click select One
- Chose your Conversion Window (post click) and view through window settings
- Select whether you would like PDF Downloads to be included as Conversions note this data will fuel any automated bidding strategies if you select Yes
- Select your attribution model
- Click Create and continue
- Important Google often prompts you to enable Enhanced CPC at this point leaving this enabled will switch all campaigns onto eCPC
- Select Use Google Tag Manager from the install options list
- Copy your Conversion ID and paste this into the relevant box in your new tag in Google Tag Manager
- Repeat this process for Conversion Label
- You can now click Next and Done in Google Ads
- Return to Google Tag Manager and under Triggering, select the trigger we created earlier and save
- To push live, hit Submit, provide some details about the changes you made in this version and press Publish
Unlike Google Analytics, Google Ads conversions dont have hierarchal structure that allows you to pass additional data.
You will of course be able to see the specific PDFs downloaded based on the Google Analytics tag above and by ensuring your Google Ads & Google Analytics accounts are linked and sharing data.
Track PDF Downloads in Facebook Ads
- From the Tags menu select New
- Give your trigger a descriptive name, weve opted for FB PDF Download
- Select the Custom HTML tag
- Copy and paste the below cod
- Under Triggering, select the trigger we created earlier and save
- To push live, hit Submit, provide some details about the changes you made in this version and press Publish
This code utilises the Facebook Pixels built in ViewContent event and dynamically inserts the PDF URL using the Click URL variable. This will allow you to specify whether conversions within Facebook should be based on all or specific PDF downloads.
You will need to have your core Facebook Pixel in place across your website in order for the above code to work!
Track PDF Downloads in Linkedin Ads
- From the Tags menu select New
- Give your tag a descriptive name, weve opted for LI PDF Download
- Select the Custom HTML tag
- Within your Linkedin Ads account navigate to Account Assets > Conversions
- Click Create a conversion
- Give your conversion a name
- Select Download as your conversion type
- Enter a value of this conversion, this is optional
- Select your attribution settings, how many days following a click and a view would you like the conversion to attribute
- Select your credit settings, would you like the last interaction for every campaign to track conversions or only the final campaign
- Under Step 2, select the campaigns that youd like to track this new conversion
- Under Step 3, select Use an event specific pixel
- Copy the code generated below
- Return to Google Tag Manager and paste the code
- Under Triggering, select the trigger we created earlier and save
- To push live, hit Submit, provide some details about the changes you made in this version and press Publish
Linkedin Ads PDF tracking tag
Track PDF Downloads in Twitter Ads
- From the Tags menu select New
- Give your tag a descriptive name, weve opted for TW PDF Download
- Select the Twitter Universal Website tag
- Enter your Twitter Pixel ID
- Under Select tag event choose ViewContent or Download
- Within the Event parameters section, click Add
- Select content_name as the Event parameter name
- For the Value select the Click URL variable using the building blocks icon to the right
- You can repeat this step setting content_category as a fixed value of PDF
- Under Triggering, select the trigger we created earlier and save
- To push live, hit Submit, provide some details about the changes you made in this version and press Publish
Setting up your Twitter Universal Website Tag to track PDF downloads
Testing Your Tracking
Once youve implemented the tags that are relevant to your business, its time to test theyre working. For this were going to use Google Tag Managers preview mode.
- Within Google Tag Managers Workspace section, select Preview from the top right
- Next navigate to the page of your website with the PDFs in question
- You should see the Preview Window at the bottom of the page
- Click on the PDFs youre tracking whilst holding down CTRL or Command this will open the PDF in a new tab
- Note in the preview window were looking for our Tags to move from the Not Fired on This Page to the Fired on This Page section of the preview window
Congratulations, your GTM PDF download tracking is complete!
If your tags are still sat under the Not Fired section, well, we need to do something about that.
Fixing Trigger Issues
Fortunately as all of our tags are based on just one trigger, we simply need to check and potentially fix this.
- Within the Google Tag Manager preview window you will see Clicks appearing in the Summary column to the left
- Click the PDFs youre looking to track again whilst holding down CTRL or Command this will open the PDF in a new tab
- Note in the Summary column the latest click that will have appeared at the top of the list, select this
- Select the Variables tab
Variables Tab in Google Tag
- Scroll down until you see the Click URL variable
This list shows the variables based on your recent click to download a PDF. If your tags did not fire during testing, it is likely due to the fact that your Click URL did not end in .pdf as we specified.
As variable values in this list will be unique to your website, this is where we put your tracking knowledge to the test. Within the list try and isolate some variables that are unique to PDF downloads. Ideally were looking for the file URL or file name containing .pdf.
Once youve found a variable that is unique PDF downloads, we need to return to Google Tag Manager and edit our One Tag to Rule Them All.
Use the variable youve identified in the above steps and set it as the rule for the trigger. Note you will need to change this variable in the Google Analytics, Facebook and Twitter tags above also as these pass the dynamic data.
Once youve done that, repeat the testing steps.
Happy tagging folks! By combining Google Analytics Events and the various media platforms conversion tags the resulting data contains both details on specific content downloaded as well as the vital conversion data needed to influence your bidding, budgeting, testing and optimising.
A Wise Sam once said Its the job thats never started that takes the longest to finish, so go get tagging!
If you have any issues with tracking PDF downloads, let us know in the comments and well happily help out.
One Tag to Rule Them All
Co-Founder of Bind Media, based in Bath, UK. Heading up our creative team that champions beautiful reporting dashboards and landing pages that convert high ticket leads.
0 thoughts to “How to track pdf downloads google analytics”