Unlock the power of insights on your website’s engagement with our guide on “How to Track PDF Downloads in GA4”. No matter the nature of your website, tracking users’ engagement can provide valuable insight on their intent and experience. Depending on what kind of PDFs live on your website, file downloads indicate basic engagement at a minimum, and a strong intent to convert at best. 

In this guide, we’ll cover:

  • Enhanced measurement in GA4
  • How to enable enhanced measurement in GA4
  • Using parameters to see which files were downloaded
  • How to create a report with file downloads and parameters
  • What to do if your file downloads aren’t showing up

Enhanced measurement in GA4

Google introduced enhanced measurement with the release of GA4. Enhanced measurement means that with a standard GA4 implementation (i.e. no additional tools or configuration required), the platform will track and report on a variety of engagements automatically. This means that some events (like PDF downloads) are much easier to track and analyze in GA4 than they were in Universal Analytics. Enhanced measurement tracks the following events automatically: 

  • Page_view
  • Scroll
  • Click
  • View_search_results
  • Video_start
  • Video_progress
  • Video_complete
  • File_download 
  • Form_start
  • Form_submit

One caveat of enhanced measurement is that it must be enabled manually in the settings of your GA4 property account. 

How to enable enhanced measurement in GA4

    1. In your GA4 property, go to the Admin section (bottom of the left navigation column at the time of writing). 
    2. Choose Data streams under the “Data collection and modification” header.
    3. Click on the data stream for your website. 
    4. Toggle Enhanced measurement to “on.”
    5. Optional: Click on the gear icon to specify whether all or some of the events should be tracked. By default, all will be selected.

Note: enabling enhanced measurement will not provide historical data. Data collection begins at the moment you enable it. 

Using parameters to see which files were downloaded

Parameters are pieces of information that give more context to an event. Google automatically collects certain parameters with each event. For the file_download event, GA4 populates the following parameters when available (descriptions directly from Google): 

  • File_extension 

Google collects file downloads for file types (extensions) ending in pdf, xlsx, docx, txt, rtf, csv, exe, key, and pp(s|t|tx), 7z, pkg, rar, gz, zip, avi, mov, mp4, mpeg, wmv, midi, mp3, wav, wma

  • File_name

The page path of a file download (for example, ‘/menus/dinner-menu.pdf’

  • Link_classes

The HTML class attribute for an outbound link or file download. For example, if a user clicks a link ‘<a class=”center” href=”www.youtube.com”>’, this dimension returns ‘center’.

  • Link_id

The HTML id attribute for an outbound link or file download. For example, if a user clicks a link ‘<a id=”socialLinks” href=”www.youtube.com”>’, this dimension returns ‘socialLinks’.

  • Link_text

The link text of a file download.

  • Link_url

The full URL for an outbound link or file download. For example, if a user clicks a link ‘<a href=”https://www.youtube.com/results?search_query=analytics”>’, this dimension returns ‘https://www.youtube.com/results?search_query=analytics‘.

How to create a report with file downloads and parameters

Now that we know that this data exists in GA4, where can you find it? 

Total file downloads in GA4

If you’re just looking for the number of total file downloads regardless of their type, name, etc., you’ll find it under Reports > Engagements > Events. If your GA4 property has different names or structure of reports, just look for an “Events” tab. The event count for file_download reflects how many downloads of all files occurred in your selected date range. 

File downloads by parameter (type, name, etc.)

The easiest way to view file downloads by their parameters is to use the Explore tab on the left side of your property. 

  • Create a blank exploration. 
  • Add dimensions to your report. 

The key dimension to add is “Event name.” The other parameters such as Link text, File name, etc. will also fall under Dimensions. We recommend adding all file-download-related parameters from the list above at first, in case something does not show up or shows up in a different area than expected. You can remove unnecessary dimensions later. 

  • Add metrics to your report. 

The key metric is event count. We also prefer to add user count and event count per user. 

    1. Drag and drop the dimensions and metrics added to their respective columns. (We find this step redundant, but this is Google’s process!)
  • Add filters.

Initially, your report will include every event in the event name column (page view, click, scroll, etc.). To filter ONLY on file downloads, create a filter at the bottom of the panel for the “Event name” field: Event name contains “file_download.” 

You can add additional filters for the other parameters. For instance, you might want to include only downloads where the file type contains “pdf,” or for a specific file name.

  • Adjust your date range in the top left. 

What to do if file downloads aren’t showing up in GA4 

Seeing an event count of “0” for file downloads can be frustrating. Here are a few tips to troubleshoot file downloads in GA4: 

Ensure that enhanced measurement is enabled.

Visit the first section of this blog (Enhanced measurement in GA4) to review how to do this. Remember: enhanced measurement starts collecting data when you enable it. Enabling it will not provide any retroactive data. 

Download a file to test tracking.

If it’s possible, the problem is simply that no one has downloaded a file, you can test a file download for yourself. To do this, open the Reports tab on the left side of your GA4 property. Then open Realtime from the left panel list. The Realtime report shows what occurred within the last 30 minutes on your website.

In the Realtime report page, find the tile called “Event count by Event name.” Download a file or files from your website. A file_download event should appear in the tile within a few minutes. 

If the event appears, you can click into it to see which parameters populated with the event. If the event never appears, this is a strong sign you’ll need to move onto option 4.

Ensure you don’t have too many filters on. 

If you’re seeing file_download events populate in the Realtime view but are struggling to create an Exploration report with them, make sure you don’t have too many filters that are excluding data.

You may need to use Google Tag Manager or work with a web developer if GA4 cannot detect file downloads automatically.

If you’ve tried troubleshooting file downloads from the list above without success, your website probably requires additional work to track downloads properly. Web developers may be able to adjust code on the backend of your site to make it more readable to Google, or you can track file downloads with Google Tag Manager. 

If you’d like to implement Google Tag Manager yourself, AnalyticsMania has an excellent article on how to do this specifically for PDF download tracking.

Need help tracking PDF downloads in GA4? 

Here at OpGo, we focus heavily on measuring results. We have extensive experience tracking PDF downloads, and many other conversion actions using Google Tag Manager and enhanced measurement in GA4. 

Contact us today for a free discovery session to learn more about how we can help!