How to Track File Downloads in Google Analytics 4 (GA4)

I was happy to find out that Google Analytics 4 can track file downloads. However, I didn’t find any native report in the interface to display the downloaded file names, other than for the last thirty minutes. It actually requires jumping through a lot of hoops to set up a report to do this. After searching online, I found a great video from Growth Learner which explains this and many other things.

In this post, I’ll try to summarize the steps to generate a report in Google Analytics 4 showing the filenames of the files that have been downloaded on your site. No Google Tag Manager required.


1. Make Sure Tracking of File Downloads is Enabled

The first thing you should do is verify that Enhanced Measurement is enabled for File Downloads. This is enabled by default, so you’re probably fine, but if you want to verify, log into your GA4 account, here’s how:

Click Admin -> Setup Assistant -> Enhanced Measurement -> Click your site name

Once there, click “+ 3 more” in the Enhanced Measurement section to show all of the items you’re measuring. Make sure “File downloads” is one of them.

Google Analytics 4 Enhanced Measurement showing File downloads
Google Analytics 4 Enhanced Measurement showing File downloads

If not, add it by clicking the gear icon.

2. Create an Exploration

The next thing you want to do is create an “Exploration”, which is just kind of a fancy name for a custom chart.

In the left sidebar menu of Google Analytics 4, click on Explore, then click the plus sign to create a blank Exploration.

Google Analytics 4 Explorations
Google Analytics 4 Explorations

3. Add Variables

In the left Variables column, there are areas for Dimensions and Metrics. You’ll want File name as one of your dimensions and Event count as one of your metrics. Click the plus sign to add these.

Google Analytics 4 variables
Google Analytics 4 Exploration variables to add

4. Drag to Tab Settings

Once you’ve added the proper variables in the Variables column, they become available to drag to the Tab Settings column.

Click the bar graph icon near the top, then drag “File name” to BREAKDOWNS and “Event count” to VALUES as shown:

Google Analytics 4 Exploration Tab Settings
Google Analytics 4 Exploration Tab Settings

Even though you will see data, you’re not done yet…


5. Set Filters

You need to filter the result so that only file downloads show up in the graph. Go to the FILTERS section. Drag or select Event name, then set it to “exactly matches” “file_download” as shown:

Google Analytics 4 Exploration filter
Google Analytics 4 Exploration filter

Once you’ve done that, you should see a nice graph to the right with downloaded filenames as the y-axis and the number of downloads as the x-axis!

If you have long filenames, it might be kind of hard to read, but you can export the results to a spreadsheet.

6. Set Data Retention Time

The time frame for the graph is set in the pulldown in the Variables column. Reader Tony noticed that in his account, he could only select the last 60 days of data though. I had the same problem with my account too!

The solution, he found, is to set your “data retention” to 14 months (the max) instead of 2 months (the default). To do this, go to your GA4 account -> Admin (gear icon in the lower-left corner) -> Data Settings -> Data Retention, and set that to 14 months as shown:

Unfortunately, I don’t know of a way to make it save data for more than 14 months.

Hope this helps! Did it work for you? Please leave a comment below. – Brian


Please Leave a Question or Comment

Subscribe
Notify of
guest
16 Comments
Inline Feedbacks
View all comments
Maya
1 month ago

Great info, thank you!
We have some file downloads that are not automatically tracked through Enhanced measurements, for example .dmg downloads for macOS. Is there an easy way to track those too?

Andrew Enoch
1 month ago

Just what I was looking for..unbelievable how difficult this information is to find! Thankyou Brian!

Leslie Church
Leslie Church
1 month ago

Great information. Thanks! Is there any way to export from one account into another account?

Tony Ballinger
Tony Ballinger
1 month ago

Very helpful article! When I look at my file downloads report, it won’t let me select a start date older than 60 days. Is there some way to see more than the past 60 days, or can the file report only show 60 days of activity? Thanks for any guidance you can provide on this.

Tony Ballinger
Tony Ballinger
1 month ago
Reply to  Brian Shim

Brian,
I just discovered that the default data storage for a GA4 account is set to 60 days. It appears to have 2 options: 2 months and 14 months. We’ve now set ours to 14 months. Hope this helps someone else!

Matin J. Osborne
2 months ago

Very helpful — thank you. Before finding your page I thought I was going to have to spend hours learning about Google Tag Manager!

Karsy
Karsy
2 months ago

That worked great! Can we save these reports and schedule emails to clients like we did in GA3?

Last edited 2 months ago by Karsy
Jake
2 months ago

Exactly what I was looking for. Thanks!

Shares
%d bloggers like this: