How to Track PDF Clicks in Google Analytics
Your website's PDF downloads are a goldmine of user intent, but by default, Google Analytics doesn't tell you anything about them. A click on a PDF for a case study, spec sheet, or guide is a clear signal of high engagement, and tracking it is essential. This tutorial will show you exactly how to set up PDF click tracking in Google Analytics 4, starting with the simple, automated method and moving to a more powerful, customizable approach.
Why Should You Track PDF Clicks?
Tracking a page view tells you someone landed on your content. Tracking a PDF download tells you someone was so interested they wanted to take a piece of your content with them. This is a much stronger signal of intent and helps you answer critical business questions like:
Which content resonates most? Are users downloading your "Beginner's Guide to SEO" more than your "Advanced SEO Techniques" whitepaper? This tells you where to focus your content creation efforts.
Is your sales collateral effective? Knowing how many potential customers download your product spec sheets or brochures can help your sales team gauge interest.
Are your lead magnets working? If you offer an ebook in exchange for an email, you'll want to see how often that download link is actually clicked after someone signs up.
What brings in engaged users? By connecting PDF downloads to traffic sources, you can see which channels (organic search, social media, paid ads) are delivering an audience that is truly engaged with your deepest content.
Without tracking these clicks, you're missing valuable data about what your audience truly values.
Option 1: The Easy Way with GA4 Enhanced Measurement
For most users, Google Analytics 4 can handle PDF tracking automatically with a feature called Enhanced Measurement. This feature automatically listens for certain user interactions on your website, including file downloads. It's often enabled by default, but it's always a good idea to check and understand how it works.
Step 1: Check your Enhanced Measurement Settings
First, let's confirm that GA4 is set up to capture file downloads.
Log in to your Google Analytics account and navigate to the Admin section (the gear icon in the bottom-left).
In the Property column, click on Data Streams.
Select the appropriate data stream for your website. It will likely be named after your site URL.
Under the "Events" section, you'll see a heading for Enhanced measurement. Make sure the toggle is on.
Click the gear icon on the right to see the specific interactions being measured. Ensure that File downloads has a checkmark next to it. If it doesn't, check the box and click Save.
That's it! As long as this feature is enabled, GA4 will now automatically track clicks on links that lead to common file types, including .pdf, .docx, .xlsx, .txt, and more.
Step 2: Find File Download Data in Your Reports
Once GA4 starts collecting data (it can take up to 24-48 hours to appear in standard reports), you’ll find it bucketed under an event named file_download.
In the left-hand navigation, go to Reports → Engagement → Events.
You'll see a list of all events tracked on your site. Look for file_download in the "Event name" column and click on it.
Clicking on the event name takes you to a detailed report for just that event. Here, you'll see Cards that display things like User and Event trends. What’s most useful, though, are the event parameters automatically collected by GA4:
file_extension: The type of file, such as "pdf" or "docx".file_name: The full URL path and name of the file that was downloaded. For example, "/downloads/my-case-study.pdf".link_text: The actual anchor text of the link the user clicked (e.g., "Download our case study").link_url: The full destination URL of the link.
This method is fantastic because it requires zero code and minimal setup. For many, this level of detail is more than enough to understand which files are being downloaded.
Option 2: The Customizable Way with Google Tag Manager (GTM)
Sometimes you need more control. Maybe you want to name the event something different, add extra contextual information, or your site's structure prevents Enhanced Measurement from working correctly. For these scenarios, Google Tag Manager is the perfect tool.
Heads up: If you use GTM to track PDF downloads, you must disable automatic file download tracking in GA4's Enhanced Measurement settings (from Option 1). Otherwise, every click will be recorded twice, and your data will be inflated.
Step 1: Prepare Your Variables in GTM
First, we need to ensure GTM is paying attention to the details of link clicks. We do this by enabling built-in click variables.
In your GTM container, navigate to Variables from the left menu.
Under the "Built-In Variables" section, click Configure.
Scroll down to the "Clicks" section and check the boxes for Click URL and Click Text. These are the main variables we’ll need.
Step 2: Create a Trigger
Next, we need to tell GTM when our tag should fire. We only want it to fire when a user clicks on a link pointing to a PDF file.
Navigate to Triggers and click New.
Give your trigger a descriptive name, like "Link Click - PDF Downloads".
Click inside the "Trigger Configuration" box and choose the trigger type Just Links under the Click group.
For "This trigger fires on", select Some Link Clicks.
Now, set up the firing condition. From the dropdown menus, create this rule: Click URL → ends with → .pdf
Tip: To make this non-case-sensitive, you can use RegEx. Set the condition to Click URL → matches RegEx (ignore case) →
\.pdf$. You could also track multiple file types with a rule like\.(pdf|docx|zip)$.Click Save.
Step 3: Create the GA4 Event Tag
Now we create the tag that sends the actual data to Google Analytics when the trigger conditions are met.
Navigate to Tags and click New.
Give your tag a clear name, like "GA4 Event - PDF Download".
For "Tag Configuration", select Google Analytics: GA4 Event.
In the "Configuration Tag" dropdown, select your existing GA4 base tag (the one you use to send pageviews).
In the "Event Name" field, enter a custom name. For clarity, let’s use pdf_download_custom. This helps distinguish it from GA4's default event.
Expand the Event Parameters section and click Add Row. This is where we add the extra details:
Parameter Name:
file_urlValue:{{Click URL}}(click the lego-brick icon to select the variable)Parameter Name:
link_textValue:{{Click Text}}
You now have a tag that will send an event called
pdf_download_customto GA4, along with the URL of the clicked file and the text of the link.
Step 4: Attach the Trigger and Publish
Finally, we link the tag to the trigger:
Below the Tag Configuration, click inside the Triggering box.
Select the "Link Click - PDF Downloads" trigger you created in Step 2.
Click Save.
Always test your changes using GTM's Preview mode. Connect to your site, click a PDF link, and watch the GTM preview console. You should see your "GA4 Event - PDF Download" tag fire when you click the link. Once you're confident it's working, click the Submit button in GTM to publish your changes.
Verifying Your Data in Google Analytics
Whether you used the simple or advanced method, you'll want to verify that the data is arriving in GA4 correctly.
For immediate testing: Use the Realtime report in GA4. After you click a PDF link on your site (even in GTM preview mode), you should see your event (either
file_downloadorpdf_download_custom) appear in the "Event count by event name" card within a minute or two.For long-term analysis: As mentioned before, data will populate the Reports → Engagement → Events section within 24-48 hours.
Pro Tip: Register Custom Dimensions
If you're using the GTM method and sending custom parameters like file_url, GA4 won’t automatically make them available in all reports. You need to tell GA4 to recognize them as custom dimensions.
Go to Admin → Custom definitions → Custom dimensions.
Click Create custom dimensions.
Enter "File URL" as the Dimension name, "Event" as the Scope, and "file_url" as the Event parameter (this must match exactly what you put in GTM).
Click Save.
Now, after 24 hours, you'll be able to use "File URL" as a dimension in your custom Exploration reports, allowing you to build much richer reports around your PDF downloads.
Final Thoughts
Tracking PDF downloads closes a significant gap in understanding user behavior, transforming generic page traffic into actionable insights about your most valuable content. Whether you use GA4's straightforward Enhanced Measurement or opt for the deeper control of Google Tag Manager, you’ll be much better equipped to see what your audience really cares about.
We know that setting all of this up, digging through reports, and waiting for custom dimensions to populate can be a real time-sink. Instead of spending hours in GA4, Graphed connects directly to your data sources and empowers you to get answers in seconds. You can connect Google Analytics and simply ask questions like, "Show me a list of my top 10 downloaded PDFs this month," and get an instant, clear report without wrestling with event parameters or building explorations.