Skip to content

Commit 6d22bbc

Browse files
Merge pull request #802 from plausible/cms/blog/2024-05-22-how-to-track-file-downloads-in-web-analytics
Automatically generated. Merged on Netlify CMS.
2 parents a26565d + dce817f commit 6d22bbc

File tree

2 files changed

+95
-26
lines changed

2 files changed

+95
-26
lines changed

_posts/2024-05-22-how-to-track-file-downloads-in-web-analytics.md

Lines changed: 95 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: post
3-
title: How to track file downloads in web analytics
3+
title: How to track file downloads on your website using analytics tools?
44
description: If your website has downloadable content or software, track how
55
they are performing, how effective is your distribution strategy and how to
66
optimize these two.
@@ -10,9 +10,9 @@ author: hricha-shandily
1010
image: /uploads/track-file-downloads.png
1111
image-alt: How to track file downloads in your analytics
1212
---
13-
If you have a website with downloadable resources like content or software, it’s a good practice to track how they are performing for your audience and business/marketing. Staying in sight of this information reveals interesting insight into how valuable a resource is to your audience, how effective is your distribution strategy and what improvements can be made to these two.
13+
If you have downloadable files on your website, such as PDFs, eBooks, apps, brochures, etc., and are curious about how they are performing, i.e. which files were downloaded, from where on your website, by which audience, etc., then it can be done using analytics tools like Google Analytics, a privacy-friendly alternative like Plausible, or other methods.
1414

15-
It is therefore a direct reflection of the degree of value a business or marketing is generating for its audience, and could offer deeper analysis into a business’ core strategy itself. Let’s see what a file download is, and how to keep in touch to improve your marketing and distribution strategies.
15+
Here's everything you need to know about what you can track about your file downloads and how.
1616

1717
1. Ordered list
1818
{:toc}
@@ -28,9 +28,96 @@ A downloadable file on a website can be any of the following:
2828
* An audio, video, or PDF download, that could be anything from a song download to a research paper download.
2929
* Anything else.
3030

31-
Most web analytics tools, including Plausible, track a file download as a link click including a specific extension. Plausible tracks the following: `.pdf`, `.xlsx`, `.docx`, `.txt`, `.rtf`, `.csv`, `.exe`, `.key`, `.pps`, `.ppt`, `.pptx`, `.7z`, `.pkg`, `.rar`, `.gz`, `.zip`, `.avi`, `.mov`, `.mp4`, `.mpeg`, `.wmv`, `.midi`, `.mp3`, `.wav`, `.wma`, `.dmg`, and other custom extensions.
31+
## How to track file downloads on your website with Google Analytics 4?
32+
33+
If you use GA4, you have two options to track file downloads as outlined below. Once done, you can find your file download events in your "Events" report or create a custom report from scratch as you wish.
34+
35+
### By enabling Enhanced Measurements
36+
37+
Open your GA4 account, go to admin > data collection and modification > data streams. Choose the data stream you want to update.
38+
39+
In the Enhanced measurement section, toggle the switch to On to activate all tracking options. This includes the "file downloads" tracking too.
40+
41+
In case you want customize individual measurement options, click the gear icon and select just the tracking options you want to keep.
42+
43+
If you're using the Google tag on your site, ensure each event type is enabled for automatic tracking. By default, all events are turned on.
44+
45+
Now, when someone clicks a link on your website that points to a common file type (see list), Google Analytics can automatically track it as a file download event (*file_download*).
46+
47+
* document
48+
* text
49+
* executable
50+
* presentation
51+
* compressed file
52+
* video
53+
* audio
54+
55+
**Two shortcomings of this method are:**
56+
57+
* If the URL containing your file download is longer than 100 characters, the end gets cut off—which often includes the file name or extension.
58+
* You cannot customize the list of supported file extensions, so you are limited to: *.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.*
59+
60+
If you want to overcome these shortcomings, your other option is to do a custom setup:
61+
62+
### With Google Tag Manager
63+
64+
Here's an overview of what you'd need to do:
65+
66+
1. Create a variable to get the file name from the clicked URL. *E.g., `guide.docx` from `https://yourdomain.com/resources/guide.docx`.*
67+
2. In Google Tag Manager, set up a link click trigger that detects specific file types (e.g., `.mp3`, `.zip`, `.docx`).
68+
3. Create a GA4 event tag
69+
4. Test your setup using GTM's preview mode + Debugview.
70+
5. Disable file download tracking as an enhanced measurement.
71+
72+
This is a complicated and lengthy process, and requires access to technical resources or a GA/GTM agency that can execute the setup for you. There are a couple of other issues as well.
73+
74+
## Problems with tracking file downloads with GA4
75+
76+
Whether you use the flexible method using Google Tag Manager or the Enhanced Measurement, you'll be prone to the following issues:
77+
78+
* You will end up missing some file downloads data as Google Analytics script is widely blocked by various internet users using ad blockers, privacy-friendly browsers. This can also happen when your cookie consent banner is declined by someone. Ultimately leading to [missing stats](https://www.orbitmedia.com/blog/inaccurate-google-analytics-traffic-sources/) and misleading insights.
79+
* Bots and spam traffic can skew your file download data as GA4's bot filtering mechanisms are not great. In a [controlled experiment](https://plausible.io/blog/testing-bot-traffic-filtering-google-analytics), we saw first-hand how GA4 allowed bots to show as real users in the dashboard. If such non-human visits trigger your file downloads, your stats will simply be misleading.
80+
81+
If you're worried about inaccurate stats, and want a simpler and effective method of tracking file downloads on your site, you can check out Plausible Analytics.
82+
83+
## Plausible Analytics for tracking file downloads
84+
85+
Plausible Analytics is a simpler, privacy-friendly and [more accurate](https://plausible.io/most-accurate-web-analytics) alternative to Google Analytics. All the shortcomings with GA4 wrt tracking file downloads, are not present with Plausible:
86+
87+
* We are significantly less blocked by ad-blockers and privacy-respecting browsers due to our privacy-friendly nature.
88+
* You don't need a cookie consent banner to operate Plausible as we use cookieless tracking and have in-built GDPR compliance.
89+
* Our bot and spam tracking exclusion is top-notch. Here's proof from a latest [test](https://plausible.io/blog/testing-bot-traffic-filtering-google-analytics).
90+
* You don't need to go through a complicated and lengthy workflow if you want to track custom extensions.
91+
92+
### How to track file downloads on your website with Plausible Analytics?
93+
94+
If you don't have an active Plausible account, you can [get started](https://plausible.io/docs/register-account)
95+
96+
Then, simply enable "File downloads" as an optional measurement when adding a new site to your Plausible account, or at any later time in the "Site Installation" area of the "General" section in your site settings.
97+
98+
![enable-file-downloads-tracking](/uploads/enable-file-downloads-tracking.webp "enable-file-downloads-tracking")
99+
100+
Insert the displayed snippet into your site for all tracking to work as expected.
32101

33-
## Why track file downloads?
102+
P.S. We are working on an update where you won't need to update the tracking snippet either and would be able to enable tracking with just a flip of a switch.
103+
104+
Once done, we automatically start collecting file download events each time a link is clicked containing any of the following file extensions: `.pdf`, `.xlsx`, `.docx`, `.txt`, `.rtf`, `.csv`, `.exe`, `.key`, `.pps`, `.ppt`, `.pptx`, `.7z`, `.pkg`, `.rar`, `.gz`, `.zip`, `.avi`, `.mov`, `.mp4`, `.mpeg`, `.wmv`, `.midi`, `.mp3`, `.wav`, `.wma`, `.dmg`
105+
106+
A new goal appears on your dashboard called "File download" and you can see all the related data such as:
107+
108+
* The number of total file download clicks
109+
* The number of unique file download clicks
110+
* The conversion rate
111+
* Top referral sources that lead to clicks
112+
* [Top pages](https://plausible.io/blog/analyzing-landing-pages) that drive the clicks
113+
* Countries, regions and cities that click on file download
114+
* Devices (screen size, browser, OS) that click on file download
115+
116+
...in a single dashboard. You can check out our [live demo](https://plausible.io/plausible.io) to see what we mean.
117+
118+
For in-depth instructions and guidance on tracking custom file types, check out [our documentation](https://plausible.io/docs/file-downloads-tracking).
119+
120+
## What to do with these insights?
34121

35122
Tracking how your downloadable files are performing can help you learn about…
36123

@@ -56,23 +143,9 @@ If your downloadable resources are a part of a marketing campaign or a [funnel](
56143

57144
If your downloadable file is gated behind a contact form, tracking its downloads can help understand which content drives the most form submissions. In turn, you can measure the effectiveness of your lead generation efforts.
58145

59-
## How to track file downloads on your website?
60-
61-
File downloads are pretty standard to track with any Web Analytics tool. If you are using Plausible, adding the code snippet for [tracking file downloads](https://plausible.io/docs/file-downloads-tracking) to the Plausible integration script is optional. Once done, it starts capturing file download events each time a link is clicked containing a file extension.
146+
Staying in sight of this information reveals how valuable a resource is to your audience, how effective is your distribution strategy and what improvements can be made to these two.
62147

63-
All types of file extensions can be tracked with Plausible, either by default or by specification. On the Plausible dashboard, you will be able to see:
64-
65-
* The number of total file download clicks
66-
* The number of unique file download clicks
67-
* The conversion rate
68-
* Top referral sources that lead to clicks
69-
* [Top pages](https://plausible.io/blog/analyzing-landing-pages) that drive the clicks
70-
* Countries, regions and cities that click on file download
71-
* Devices (screen size, browser, OS) that click on file download
72-
73-
If you don’t have file downloads to track, you can keep the original script intact, which is effective and efficient. This helps us keep our main tracking script lightweight and not deteriorate page load speeds and visitor experience.
74-
75-
Google Analytics 4, on the other hand, has a bloated tracking script as it comes with automatic file downloads tracking as part of its Enhanced Measurements. A compressed Google Analytics integration script is much larger than [Plausible’s lightweight script](https://plausible.io/simple-web-analytics).
148+
It is therefore a direct reflection of the degree of value a business or marketing is generating for its audience, and could offer deeper analysis into a business’ core strategy itself. Let’s see what a file download is, and how to keep in touch to improve your marketing and distribution strategies.
76149

77150
## How to optimize for file downloads?
78151

@@ -96,8 +169,4 @@ Figure out which kinds of audiences (and whether they are your ideal customers)
96169

97170
### Monitor and adjust
98171

99-
Keep an eye on metrics such as download counts, conversion rates, and referral sources to identify emerging patterns. Adjust by promoting, updating, or withdrawing resources as needed.
100-
101-
## Before you go…
102-
103-
We're creating a series on Web Analytics features, like this one, to help you learn and apply web analytics with ease. If you have specific topics you'd like us to cover, let us know at [reading@plausible.io](mailto:reading@plausible.io). We're listening!
172+
Keep an eye on metrics such as download counts, conversion rates, and referral sources to identify emerging patterns. Adjust by promoting, updating, or withdrawing resources as needed.
145 KB
Loading

0 commit comments

Comments
 (0)