Tracking File Downloads With Google Analytics 4 and WordPress

Tracking File Downloads With Google Analytics 4 and WordPress

Wondering how you can track the number of times users click on the downloadable items on your website? With Google Analytics 4 it is a cakewalk!

Knowing the number of times the downloadable file content on your WordPress site has been clicked helps you make further improvements to your marketing strategy and is a great way to predict your audience’s interest and determine the type of content you should offer to your readers.

As you might have known, recently Google Analytics has switched from the age-old Universal Analytics to the all-new Google Analytics 4. If you are wondering whether you would be able to track file downloads in the latest GA4, of course, you can!

And in this article, we’ll tell you more about how you can do exactly that.

How to track using GA4

With Universal Analytics all you can track is just the page views. But, now with the improved GA4, you can track different events using the ‘Enhanced measurement’ feature without installing any plugins, or setting up complicated codes.

To set up tracking the file downloads on your site, click the admin settings option from the dashboard

GA4 admin dashboard
Select admin option in Analytics dashboard

Ensure the account and property are chosen correctly. Under the property column, click the ‘Data streams’ property.

Data streams property
Select data streams property

Clicking on this property will display a list of all the available data streams associated with the chosen account and property. From the available data streams, select the one for which you want to set up a file download tracking event.

View data stream
View web stream data in detail

In the web stream details page, scroll down to the Events. Out of all the available event options, enable the ‘Enhanced measurement’ option if it is not already enabled.

Enable enhanced measurement
Enable the enhanced measure option

After enabling it, Click on the ‘more‘ link to view all the enabled measures. Usually, file downloads measure is enabled.

However, if not, then click on the ‘Setting (gear)’ icon.

Events settings
Click gear icon to configure Enhanced measurement settings

And from the side pane that opens up, enable the ‘File downloads’ option.

Enable file downloads event
Enable the file downloads event option

And click ‘Save’.

Save enhanced measurement
Click Save to save the enhanced measurement configuration

After enabling the file downloads tracking, wait for about 24 – 48 hours for the data to propagate in the reports dashboard.

Supported file extensions

If you are wondering what file types GA4 can track – pretty much everything. Here is a list of all the supported extensions:

.pdf, .xls, .xlsx, .doc, .docx, .txt, .rtf, .csv, .exe, .key, .pps, .ppt, .pptx, .7z, .pkg, .rar, .gz, .zip, .avi, .mov, .mp4, .mpe, .mpeg, .wmv, .mid, .midi, .mp3, .wav, .wma

Where to find the insights?

Now that we have successfully enabled the file download tracking event, let’s see how you can view the tracking report and insights.

The file download event tracks the following parameters:

  • file_extension – The extension of the file
  • file_name – The name of the file
  • link_text – The anchor text of the link that initiates a file download
  • link_url – URL of the link that initiates a file download
  • link_classes – The value of the HTML class attribute of the outbound link
  • link_id – The value of the HTML ID attribute of the outbound link
  • link_domain – The destination domain of the link

But by default, the standard report view displays only the ‘Event Count’ and the ‘Total Users’. If you want to know how to view other parameters in the report, jump to the create custom reports section.

To view the tracking data, select the ‘Reports’ menu in the analytics dashboard.

In the reports menu, select the ‘Events’ option under the ‘Engagement’ category as highlighted below

Analytics event tab
View the report snapshot of events in analytics

The events dashboard displays a detailed list of all the currently tracked events. Note that the event details include only the standard events and not custom events.

Events list
A list of all the currently tracked events in analytics

Click on the file_download event to view a detailed insight on this.

File download event snapshot
View the report snapshot of the file_download event

Limitations of GA4 file download tracking event

There are several limitations to the standard file tracking functionality of GA4. Some of these include:

i. The link URL displays only a maximum of 100 characters – The link URL dimension of the file_download event displays only a maximum of 100 URL characters and the rest are trimmed.

ii. The file extensions list cannot be customized – The file extensions that you want to exclude from download tracking can’t be customized. This can be a limitation if you have a variety of downloadable files on your site. However, you can filter the report to view the download analytics only for the file you want.

iii. The file names aren’t displayed in the standard report – In the standard report view, you will not be able to view the names of the files that have been downloaded, and only the number of downloads and other demographical information is displayed.

However, with a few additional steps, you can easily create your own custom reports to display additional information including the file names, extensions, link text, and link URL. Let’s look at how to create these custom reports in GA4.

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

Create Custom Reports

In this section, let’s see how you can create custom reports in GA4.

In the analytics dashboard, click on the ‘Explore’ tab and click ‘Blank’ to create a new blank exploration.

Create blank exploration
Create a new blank free form exploration

Under the ‘Variables’ section, click on the ‘+’ icon in the ‘Dimension’ section to import the dimensions you want to track.

Dimensions search bar
Search the available dimensions using search bar

This will open up the ‘Select dimension’ modal with a list of all the dimensions available for import. In our case, we’re going to import the file extension, link URL, and link text.

So, let’s import these dimensions. You can use the search bar to search for these dimensions.

Similarly, in the ‘Metrics’ section click on the ‘+’ to import the metrics that you want to
track for the chosen dimension(s).

Custom report rows
Add the dimensions to track as rows in the table

Now that we have added all the required dimensions, drag the dimensions that should be displayed in the rows of the table under the ‘Rows’ section.

Similarly, drag the metrics that provide the numeric data for the chosen dimension under the ‘Values’ section as highlighted below.

Custom report values
Add the metrics to track in the values section

This data is for all the events that are currently tracked in your report and not just for the file_download event. To view the data of just the file_download event, apply the following filter:
‘Event name’ exactly matches ‘file_download’

Custom report filters
Add a filer to view the file_download event data in the report

Make sure to import the ‘Event Name’ dimension to apply this filter.

Tracking File Downloads With a Plugin

If all of the above sounds a little too much like hard work for your liking, you’ll be happy to hear there are also a number of plugin solutions available for taking care of tracking and managing file downloads in WordPress. Here are three of the more common options to check out:

  • 1. Google Analytics Dashboard for WP

    The Google Analytics Dashboard for WP plugin brings your key site data directly into WordPress and also enables you to view information about downloads stored as events. With over 600,000 active installs and a solid near five-star rating, this plugin is a handy way of bringing some of the power of Analytics directly to your dashboard.

    Interested in 1. Google Analytics Dashboard for WP?

  • 2. Download Monitor

    Download Monitor takes a slightly different approach to the matter of file downloads and puts them on a par with items such as posts and pages in your back end.

    The plugin enables you to categorize, tag, and add custom meta information to your downloads, as well as tracking downloads and offer advanced features such as member-only downloads. A set of powerful extensions are also available if you need to take even more control of downloads on your site.

    Interested in 2. Download Monitor?

  • 3. WordPress Download Manager

    In addition to download counters and reporting, the WordPress Download Manager also enables you to integrate smoothly with Google Drive, Dropbox, and Box.com. A full suite of more advanced e-commerce options relating to downloads is also available with the premium version of the plugin.

    Interested in 3. WordPress Download Manager?

Start Tracking Your Metrics

We hope this article helped you set up file tracking on GA4 to gain insights into how your users engage with your website and content using GA4-enhanced features like events and enhanced measurement.

With these metrics in hand, you can have a better understanding of which content and file types perform great. Go ahead and start tracking these valuable metrics!

Do you track your file downloads? How do you do it? If you have your own tips or tricks, or any questions about how to set up event tracking, let us know in the comments below.

Tags:

Aileen Javier Aileen has over 10 years of experience in content writing and content marketing. She’s handled content teams, planned editorial calendars, and managed projects. She’s also written blogs, web copy, social media posts, and email newsletters for brands in different industries.