Tracking downloads of files on your website is much easier in Google Analytics 4 than it was in Universal Analytics. And although files are important building blocks of your site and marketing, it’s not so obvious to find the data in GA4. But that will change when you read further on…
- It’s easy to misunderstand file downloads in GA4. Amongst many things, this technique is not ideal for files you use for lead generation.
- In GA4, you can easily set up automatic tracking of file downloads.
- Besides the usual pdf documents, GA4 recognizes data for 6 other types of files.
- You can find general data in the file_download Event report and all the details in an Exploration report.
What is tracking downloads (not) in GA4?
To prevent misunderstandings, GA4 tracking download happens when somebody clicks on a link, or button on your site to a downloadable file on your site.
This excludes the following situations, which can easily lead to misunderstandings:
1. When somebody clicks on a link in e.g. your email to a file on your site, this is not registered as a file download in GA4.
2. When somebody downloads a file after filling in their name and email address, this is not a file download either. You can track lead generation with another technique that I will explain in a later post.
3. If your file is downloadable from your domain, but from e.g. Google Drive or Dropbox, this will not show up in GA4 as a file download, but as an Outbound click event.
4. If your visitors can download your media files to their device, this counts as a download. This differs from watching or listening to your video or podcasts on your site.
How to set up download tracking of files in GA4?
To automatically track downloaded files in GA4, you need to switch on File downloads of your Enhanced Measurement settings.
Here is how you do, or check it:
Go to Admin > Property > Data Streams and click on your Web data stream.
Switch Enhanced Measurement on, if that is not the case.
Click on the clog.
Switch on File downloads and click on the Save button on top of the panel.
When someone clicks on a link to a downloadable file on your site, 24 hours later you will see the file_download event shows up under Configure > Events.
That reminds me of downloading a file in the 90s.
A faster way is to click on a link on your website to download a file and debug GA4 to see if the event is actually triggered.
When nothing happens, you might use a file type that is not included in the list of GA4 supported extensions…
Which file types does GA4 recognize as downloads?
Google Analytics 4 tracks the following documents and extensions as files:
- Document: .pdf
- Text: .docx, .doc, .txt, .rtf, .xlsx, .xls, .csv
- Executable: .exe
- Presentation: .key, .pps, .ppt, .pptx
- Compressed file: .7z, .pkg, .rar, .gz, .zip
- Video: .avi, .mov. mp4, .mpeg, .mpg., .wmv
- Audio: .midi, .mid, .mp3, .wav, .wma
This is a lot more than the usual PDF you can upload to your site. But then again, GA4 ignores many other files that can be important downloads for your site:
- if you offer downloadable vector files on your website with an .eps, .svg or .ai extension, these will not be automatically tracked with enhanced measurements.
- Clicks to links of .jpeg, .jpg and .gif files are not downloads for GA4. That’s a big bummer for stock photography sites and online tools to make digital art or marketing material.
Pro Tip: if possible, use one of the file types GA4 recognizes as downloads. You may even consider zipping a folder of unsupported files, if that makes sense to your audience, of course.
Now you know the supported extensions, it’s time to answer another important question…
Which data does GA4 collect about your downloaded files?
Just like for all other events, GA4 collects some parameters for the file_download event. These are some pieces of information you do not have to configure yourself.
At their turn, these parameters appear in GA4 as 7 different dimensions:
- File extension (see the list above)
- File name. It’s bizarre that GA4 includes the path of the file. In reality, you will see something in your reports like “wp-uploads/2022/Migration-List-To-Google-Analytics-4.pdf”
- Link domain. This is useful if you track multiple domains in your property.
- Link URL. The URL of the file.
- Link classes. This is the CSS class you use in the HTML code for your link.
- Link ID. An HTML attribute that you put in your code of the link.
- Link text. E.g.: Click here to download our cool PDF.
The really cool thing is that you, or your developer, can use Link Classes, Link ID and even Link text to dig that link and file quickly up in GA4.
- <a class=”link-in-footer” href=”https://yourcoolsite.com/your-download.pdf” >Click here</a>
- <a id=”hero-home” href=”https://yourcoolsite.com/your-download.pdf”>Click here</a>
- <a href=”https://yourcoolsite.com/your-download.pdf”>Click here NOW</a>
As you will see, you can filter these specific values of your dimensions. That makes it really easy to analyze specific links to downloads on your site.
In the past, you had to do a lot more effort with Google Tag Manager.
All clear? Let’s move to the next question.
Where is the data about downloaded files in GA4?
In GA4, you can find the data of your downloaded files in two places: the event report and explorations, followed by an export of your data.
#1. file_download event report
Go to Reports > Engagements > Events.
Then click on file_download.
Here you will find general information about your downloaded files for the selected date range. There is one card that shows the activity for the last 30 minutes on your site.
If your users are actively downloading files, you can change the parameters of the event.
This example shows you that pdf files were the only file types downloaded in the last 30 minutes.
Nice, but this report is useless.
As a data-driven marketer, you want to have data for a longer period of time.
To get that, you will need to create an exploration for your downloaded files.
#2. Exploration report with details of downloads on your site
A free exploration is the best way to unlock the data and all the parameters GA4 sends along with downloads. Follow the steps below to build your interactive report.
Start with opening a blank exploration.
You can optionally give the exploration a meaningful name, such as Download PDF report
Then you need to add dimensions with the + sign.
In the next screen, use the search function and select these 3 dimensions:
- File Extension
- File Name
- Event name
Then click on Import.
Now you need to drag the 3 events from the first tab to Row in the second tab.
Add at least one metric, such as Total Users, to Metrics in the first tab. And then drag it to Values in the second tab.
At this moment, your table is populated with events, but it can also contain clicks, scroll, etc.
You can drag the Event name dimension to Filters.
Then choose exactly matches and pick file_download.
Finally, click on Apply.
Your file download exploration is ready.
There is only one problem: you can’t see the filenames.
#3. Export your file_download exploration to Google Sheets
Your best option is to export the data with the export icon on top of the exploration.
If you, for instance, export the data to Google Sheets, you need to confirm your choice by clicking on Import the data.
And now you finally have all the data you need.
Bonus: two use cases
You made it this far, so let me reward you for persistence. .
Don’t undo the hard work of the previous steps. Instead, make a copy of the exploration you created.
#1 How to track in GA4 a specific PDF download per country?
A first adaption is to add Country as dimension and then drag it to columns (or rows).
You can add a second filter, using the file name, or any other parameter.
Done. You now have a report that shows in which countries a specific pdf file was downloaded.
#2 Conversions and download files in one GA4 report
You can add, e.g., the Conversions metrics to Values in the second tab. This way, it is possible to detect if users who downloaded a file converted.
You can offer a wide variety of useful content on your site as downloadable files:
- User manuals
- SOPs (Standard Operating Procedures)
- Mediation songs
- Instructional movies
The advantage of files over web pages is that your visitors can keep a copy and take it with them, even when being offline.
Tracking your downloads is therefore important. You know that, otherwise you wouldn’t have read this article. But I also suspect that you were struggling and confused.
I sincerely hope this article will give you inspiration and confidence.
Once you have set up an exploration to track downloads in GA4, you will find it much easier and meaningful to experiment with the CTAs of your links, the pages where you put those links and even the position on a page to put your links to downloads.