Analytics - Tag Manager

How To: Track PDF Downloads in Google Analytics 4

Source Code

TL;DR:
GA4 can automatically track clicks on PDF links using the file_download event when File Downloads is enabled in Enhanced Measurement. For most websites, this means you don’t need Google Tag Manager just to track PDF downloads. GTM is useful when you need more control, such as tracking specific PDFs, using different event names or sending additional information with the event. Both methods track the click on the file link, not whether somebody actually reads the PDF.

How GA4 tracks PDF downloads

PDF downloads can be useful interactions to measure, particularly if your website offers brochures, reports, guides, product specifications or other downloadable resources.

The good news is that if you’re using Google Analytics 4, you may already be tracking them.

GA4’s Enhanced Measurement can automatically record clicks on links to PDFs and other common file types using the file_download event. This means you don’t necessarily need to create a separate Google Tag Manager event just to track a PDF link.

In this guide I’ll show you how to check whether PDF download tracking is enabled, where to find the data in GA4, which information GA4 collects about each file, and when you might still want to use Google Tag Manager for a more customised implementation.

One important distinction before we start: GA4’s file download tracking measures clicks on links to files. It doesn’t tell you whether somebody subsequently read the PDF or how they interacted with the content inside it.

Does GA4 automatically track PDF downloads?

Yes. In most cases, you don’t need Google Tag Manager to track PDF downloads in GA4.

GA4 includes file download tracking as part of Enhanced Measurement. When somebody clicks a link to a PDF, GA4 can automatically record a file_download event.

It isn’t limited to PDFs either. Google automatically recognises a range of common file extensions, including PDF, XLS/XLSX, DOC/DOCX, CSV, ZIP, MP3 and MP4.

For each file_download event, GA4 can also collect information including:

  • file_name
  • file_extension
  • link_text
  • link_url

This means you can identify which PDF was clicked, rather than simply counting all file downloads as a single event. Google also exposes File name, File extension and Link URL as reporting dimensions.

Check that file download tracking is enabled

In GA4, go to:

Admin → Data Streams → select your Web data stream → Enhanced Measurement

Open the Enhanced Measurement settings and make sure File downloads is enabled.

Enhanced Measurement

GA4 tracks the click on the PDF link, not what happens inside the PDF.

If clicking a link opens guide.pdf in another browser tab, GA4 can record the file_download event. It doesn’t know whether the visitor subsequently read the PDF, how many pages they viewed or how long they spent reading it.

How to find PDF downloads in GA4

Once file download tracking is enabled, GA4 records clicks on PDF links using the file_download event.

To check that downloads are being recorded, go to:

Reports → Engagement → Events

Find and select the file_download event.

This report confirms that GA4 is recording file downloads and, more importantly, shows which individual files are being clicked.

In this example, GA4 recorded 18 file_download events from 12 users during the selected period. The file_name data then lets me see which individual PDFs generated those events.

This is much more useful than simply knowing that somebody downloaded something from the website.

Test that PDF download tracking is working

Don’t assume that Enhanced Measurement is working simply because you’ve switched it on.

Click a PDF link on your website yourself and use DebugView or GA4’s realtime reporting to confirm that a file_download event is being received.

Check the event parameters as well. You want to make sure GA4 is capturing the correct file rather than simply confirming that an event called file_download exists.

In the example above, you can see the file_download event firing and GA4 identifying the file extension as pdf. The event also contains parameters including file_name, link_text and link_url, which can be used to identify exactly which download was clicked.

When should you track PDF downloads with Google Tag Manager?

For most websites, GA4’s automatic file_download event will be enough. If Enhanced Measurement is collecting the downloads and the file information you need, there’s little benefit in recreating the same event in Google Tag Manager.

GTM becomes useful when you need more control over what counts as a download or what information is sent to GA4.

For example, you might want to use GTM if you need to:

  • track only specific PDFs rather than every downloadable file
  • group downloads by type, such as brochures, reports or technical documents
  • send additional information with the event
  • use a different event name for a particular type of download
  • track links that don’t match GA4’s standard file download behaviour

One thing I’d be careful about is running a custom GTM PDF download event alongside GA4’s automatic file_download event without understanding what both are doing. You can easily end up recording the same interaction twice.

If you decide to create your own PDF download tracking in GTM, first determine whether the automatic GA4 file download event should remain enabled for those links.

How to track PDF downloads with Google Tag Manager

If you need more control than GA4’s automatic file download tracking provides, you can create your own event using Google Tag Manager.

This assumes you already have GA4 configured through GTM. If you don’t, get your basic analytics implementation working correctly before adding additional event tracking.

Create a PDF download trigger

In Google Tag Manager, go to Triggers → New and choose:

Trigger Type → Click – Just Links

Set the trigger to fire on Some Link Clicks.

For a straightforward PDF download trigger, use:

Click URL → matches RegEx (ignore case) → \.pdf($|\?)

This matches links ending in .pdf as well as PDF URLs containing query parameters.

Download PDF Trigger

Before testing it, make sure the built-in Click URL variable is enabled under Variables → Built-In Variables.

Create the GA4 event tag

Create a new tag and select Google Analytics: GA4 Event.

Your existing Google tag should be detected automatically. Then give the event a name that clearly describes the interaction you’re tracking.

For this example, I’m going to use:

pdf_download

Under Event Parameters, you can also send additional information about the PDF that was clicked. For example:

file_url → {{Click URL}}

link_text → {{Click Text}}

These parameters provide additional context alongside the event, allowing you to identify which PDF was clicked and the link text the visitor used to reach it.

Test the custom PDF download event

Before publishing the new tag, use GTM Preview mode and click one of the PDF links you want to track.

Select the link click event in Tag Assistant and check that your GA4 event tag appears under Tags Fired.

In this example, my pdf_download event fired successfully when I clicked the PDF. I can also see that file_url contains the URL of the PDF and link_text contains the text of the link that was clicked.

I’d also test links that shouldn’t trigger the event. This confirms that your trigger is restricted to the PDF downloads you actually want to measure rather than firing on unrelated links.

Once you’re happy with the implementation, publish the GTM container and check that the pdf_download event is being received in GA4.

Should you use GA4 or GTM to track PDF downloads?

For most websites, I’d start with GA4’s automatic file_download event.

If Enhanced Measurement is already collecting the PDF clicks and the information you need, there’s no reason to recreate the same tracking in Google Tag Manager.

GTM becomes useful when you need more control. You might want to track only certain PDFs, use your own event naming, categorise downloads differently or send additional information about the link that was clicked.

Whichever method you use, test it. Don’t assume a PDF download is being tracked simply because Enhanced Measurement is enabled or because a GTM tag has been created.

And remember that both approaches are primarily measuring clicks on links to PDF files. They don’t tell you whether somebody actually read the PDF or what they did after opening it.

If you need a more customised analytics implementation, including tracking interactions that GA4 doesn’t capture automatically, that’s something I regularly work on as a Google Tag Manager consultant and GA4 consultant.




About The Author

I'm Dave Ashworth, a freelance SEO and website optimisation consultant with a background in development and a focus on fixing what's broken, improving what's working, and helping businesses grow through clear, practical SEO.

I combine hands-on technical know-how with years of experience in analytics, content strategy and platform optimisation. Whether it's an audit, a migration, or ongoing performance support, my work's about making websites stronger, faster, and easier to understand for - users, search engines and AI platforms.

When I'm not writing guides or sharing insights, I'm working directly with clients to solve problems, track results, and keep their sites moving in the right direction.

Dave Ashworth

get in touch

If you need some expert website optimisation and configuration, want to find out more, or even just have a question, fill in the form below as I will always be happy to help