Daniel asks, “How do I track PDF downloads and links in PDFs as goals in Google Analytics? PDFs don’t let you put Google Analytics tags in them.”
This is a common question because many people want to be able to track downloads of things like sales collateral, marketing product sheets, etc. Using the techniques shown in this video, you’ll be able to track PDFs, MP3s, and virtually any kind of file download from your website with Google Analytics and Google Tag Manager.
Can’t see anything? Watch it on YouTube here.
Listen to the audio here:
- Got a question for You Ask, I’ll Answer? Submit it here!
- Subscribe to my weekly newsletter for more useful marketing tips.
- Find older episodes of You Ask, I Answer on my YouTube channel.
- Need help with your company’s data and analytics? Let me know!
- Join my free Slack group for marketers interested in analytics!
What follows is an AI-generated transcript. The transcript may contain errors and is not a substitute for watching the video.
Today’s episode, Daniel asks, How do I track PDF downloads and links in PDFs as goals and Google Analytics? Because PDFs don’t let you put Google Analytics tags in them? Good question. And it’s a common question because in a lot of cases, people who want to track do Did someone get this PDF, especially if there’s no registration form. And for companies, particularly in b2b, a PDF download could be a valuable insight, such as someone get downloading a product sheet, a spec sheet, a prospectus something along those lines. So you want to be able to do this. The trouble is, as Dan mentioned, you can’t put Google Analytics tracking codes inside PDFs, they will not be so simply will not work. So for the second half of this question, if you want to track links in PDFs, that the easy way to do that Miss to use you tm tags and we’ve talked previously about them, but if you go to if you have put together a spreadsheet like this, and I’ll put a link in
The analytics for marketers slack up to this, you would simply set up yet another line where the source instead of the, instead of like what channels from, you might want to put a PDF or the medium, even like a PDF or even a campaign, but whatever, just use consistent ontology so that when you put PDFs on your website, and he put links inside those PDFs, you would just use YouTube codes. Now when you look at the final URL, these are kind of messy. So what you might want to do is use something like Bitly to shorten that URL when you put the link inside the PDF to be able to track it out. But once you do that, then links in PDFs can be used to to pass data back to Google Analytics when they come to your website and and do something so that’s the getting tracking inside of a PDF that’s going outbound to somewhere else. If you want to track the PDF itself someone downloading the PDF there’s if you do two things first, inside Google
analytics, go to your goals. And inside your goals, you’re going to create a an event type goal. Again, because PDFs are pages that you cannot embed tracking codes into, you’ll want to set an event based goal. So the goal set up in this case would be custom,
the event type, the description type is download PDF, it’s an event and then your details are my these are going to be arbitrary, make them whatever you want, but be consistent. So if it’s a download, like you’re downloading a product sheet, make sure it’s at the action would be a click because I’m just clicking on a link to a PDF. And then the label I typically use would be PDF, you can set a value if you know what the value of a PDF is, it’s very difficult to measure that upfront. So you can either set of something arbitrary or just leave it blank for now and you can always put a value in Tag Manager later. So the first half of the solution is to set up a goal however,
you’ll notice nothing.
Here is a tracking link. So the second half of this is you need to use Google’s Tag Manager. And what Tag Manager is going to do is Tag Manager is going to detect that someone has clicked on a PDF, like how do you do that you’re going to go into triggers and going to set up a PDF, click trigger
and it is a click on you’re going to track clicks. So you on track clicks on links, and the link type is gonna be some links. And the URL of the PDF of the URL is going to track on contains a dot PDF extension. This is going to
track when I was clicks on any kind of link on your website that has a dot PDF. Now, if you want it to be very specific to just one kind of PDF, maybe you’ve got multiples and you only care about one of them, then you would change this to be like a sample PDF or prospectus PDF,
whatever the case may be, you’re going to set that trigger and then you’re going to set up a tag which is a companion piece
and the text
Going to use your Google Analytics. And there’s that event category. Let’s go ahead and category download action. Click label PDF, it has to match what you’ve done here in Google Analytics, make it match, set it to your Google Analytics variable, and then connected to the trigger that you made the PDF, click trigger. So now what’s happening with Tag Manager is listening on the website all the time, when somebody clicks on a PDF link, the trigger fires, it says PDF, click just happen. The PDF trigger calls this tag that says, hey, Google Analytics.
I’m telling you, there’s an event happening. The event is a download with a click action and label is PDF. Google Analytics listens for tag management says I hear you. I’m going to register this as a goal and record it and that’s the process from beginning to end of how you attract PDFs. And by the way, this works for any media type so it doesn’t just have to be PDF if you want to track an mp3 that’s on your website. Maybe you have a podcast and you actually want
podcast listeners as a goal, you could have a dot mp3. If you have a video that’s a native embedded on your site. And it’s not a YouTube video, meaning it’s not hosted somewhere else, you’ve actually put the video file on your website, you can put that, you know, dot m for via that demo mo vi or whatever file any kind of file where you do not have the ability to put a Google Analytics tracking code on the within it, you would use this methodology to be able to track as goals within Google Analytics. So great question, Daniel. Because this will help you track all kinds of different files and types and things on your website and assign them as goals.
One thing you’re going to want to do later on is measure the impact of those goals. that’s a that’s a video for another time. But by doing this, you’ll have the information so remember that any girl any goal in Google Analytics is never retroactive. So this only begins working the moment you set it up and turn it all on. Remember, by the way, One very common mistake is
To make sure that you actually publish your changes and Tag Manager, a lot of people forget to hit that final step and then make all these great changes and it never goes anywhere. So make sure you do that. As always, please leave comments in the comment field and please subscribe to the YouTube channel and the newsletter and I’ll talk to you soon.
What help solving your company’s data analytics and digital marketing problems. This is a trust insights.ai today and let us know how we can help you.
You might also enjoy:
- B2B Email Marketers: Stop Blocking Personal Emails
- How to Think About Conversion Efficiency in Content Marketing
- Advanced Content Marketing Metrics: Reading Time, Part 1
- AI for Marketers, Third Edition, Available Now!
- What Is The Difference Between Analysis and Insight?
Want to read more like this from Christopher Penn? Get updates here:
Get your copy of AI For Marketers