If you have downloadable resources on your website, you probably want to know which visitors have actually downloaded them. Most of the websites owners, if not all, have Google Analytics enabled. It very easy to track downloads with Google Analytics.

Better tracking, better decision, better results

Google Analytics provides an event track feature, so you can use it to track file downloads, newsletters, and forms submission. With this information tacked, you and analyze them and make better decisions.

You will know which downloadable resources are more popular than others, so you can produce more of them.

You will know which pages bring more downloads, subscribers, or other forms of leads. Then you should bring more traffic to these high-performance pages.

How to use Google Analytics to track downloads

If it will redirect to a thank-you page when clicking on the download button, then you can simply set up a destination goal in Google Analytics. By the way, you should noindex the thank-you page, because you do not want other traffic to affect the conversions data.

What if you do not have a thank-you page or it is a thank-you pop-up instead of a page? Then you can make use of Event Track.

If you do not have too many downloadable files to track and you do not use Google Tag Manager, you can add a bit source code to your pages so they fire on a button click. It is simple, and I will show you step by step.

Change hard code

As mentioned, you just need to add an event tracking code. If you are linking to a downloadable file or PDF and the link should look like this:

<a href=”pdfs/filename.pdf” target=”_blank”>Download Now</a>

Just need to change it to:

add Google Analytics event track code

<a href=” pdfs/filename.pdf ” onclick=”ga(‘send’, ‘event’, ‘pageurl’, ‘Click’, ‘filename’, ‘1’) > Download Now</a>If you are not familiar with such codes, you can use this tool to generate your custom code for you.

If you use the latest global site tag (GTAG), use the code below:

<a href=” pdfs/filename.pdf ” onclick=gtag(‘event’, <action>, {  ‘event_category’: <category>,  ‘event_label’: <label>,  ‘value’: <value>});

GTAG Tracking Downloads

After that, when someone clicks on the Download Now button, you will see the event is fired on Google Analytics event report.

Set up Event Goal

To better see which page(s) lead to this download, you can set up an Event Goal in Google Analytics. Follow the instructions below to set up the goal.

  1. Within Google Analytics, click on Admin in the main navigation.
  2. Select the View that you want to set up goals and click on Goals under it.
  3. Click on the New Goal button and then Custom to create a custom goal.create custom goal google analytics
  4. Set a name for this goal and select the Goal Type as Event.
  5. Input all of the relevant goal details referring to the tracking code you added to your site.Goal Details
  6. Click the Create Goal button.

Wait an hour or so, you can see the data in Google Analytics > Conversions > Goals. To see how many downloads each landing page has generated, you can go to Behavior > Site Content > Landing Pages.

Besides tracking downloads, you can also use this method track any button clicks, like Add to Cart, Form Submit, Email Subscribe, etc.

If you have many buttons to track, then it may be cumbersome for you to add track code one by one. In that case, you can use the help of Google Tag Manager and Google Analytics to track file downloads.

Use Google Tag Manager Auto Event Tracking

Google Tag Manager (GTM) is a good tool to help you do many things without the need to change any code on your website. If you have not enabled it, you should do it now because its functions are unlimited.

To install GTM on your site, you head over to Google Tag Manager website and login with your Google account. You will get the GTM code and then copy the codes to your website.

To use GTM Auto Event Tracking, you need to create a Trigger to listen to all clicks that match the download button, and create a Tag to send the Category, Action, and Label to Google Analytics.

Create the Event Tag with Google Tag Manager

Create Tag for Event Tracking

Click Tags and select New to create a new tag. Then you can input the parameters referring to the below screenshot.

Tag Type: Universal Analytics

Track Type: Event

Built-in Variables

Category, Action, Label, and Value and enter information that you want to send to Google Analytics. If the Variables, you can enable it in the Variables sections. GTM has many built-in Variables.

Don’t forget to give a name to this tag. Then you need to create a trigger that this tag fired on.

To create a Trigger in Google Tag Manager

In the Trigger Configuration:

Trigger Type: Click – Just Links

This Trigger fires on: select Some Link Clicks to restrict it to only download clicks. If you want to track one specify file download, then select Click URL, Equals to, the file download URL.

Create Link Click Trigger

If you want to track all PDF downloads on any page, select Click URL, Ends with, .pdf.

If you want to track all formats of downloads, input Click URL, Matches Regex, (.pdf|.mp4|.mp3|.docx)

Then you can save the Trigger and Tag. If you are not sure whether you have set it up correctly, then you can enter the preview debug mode. Then open your website in that same browser to see if the trigger is fired when you click on the download link.

Track Downloads in Google Analytics V4

According to Google, Universal Analytics will no longer process new data in standard properties beginning July 1, 2023. V4 is much different. Now, it is recommended to implement GA V4 along side with Google Universal Analytics.

In Google Analytics V4, everything is an event and file download tracking is a built-in feature. You just need to enable it without the need to add additional tracking code. Once configured, Google Analytics V4 automatically tracks file download event.

Track Downloads Google Analytics 4

To enable it, click on GA V4 Admin > Data Streams > Web > Enhanced Measurement. From there, check the option “File downloads”. That’s it. Wait a few hours and you should be able to see downloads data in Reports > Engagement > Events.

GA V4 will collect data including file_download, file_name, file_extension, link_url, Link_text, link_classes, and link_id. The file extensions that will trigger the “file_download” event in Google Analytics V4 are listed below:

.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

If you want to track file downloads in another file extension, you can use Google Tag Manager to configure triggers for other extensions.

Conclusion

With more information collected, you can make better decisions. Downloads are an important metric that you should track now. With these methods to track downloads in Google Analytics, which one do you prefer?

For me, Google Analytics V4 is still new to me. That’s why I implemented both Google Analytics Universal and V4. If you use WordPress, you can use a plugin Site Kit from Google to set it all up easily.

8 thoughts on “How to Track Downloads in Google Analytics Automatically [V4]”
  1. Very Good Article. I really appreciate it. Well researched article. Now you got one regular visitor to your website for new topics. Keep up the Good Work Thanks for always sharing.

  2. Hi there, I discovered your blog via Google even as searching for a
    comparable matter, your website came up, it seems to be great.
    I have bookmarked it in my google bookmarks.

  3. Superb post however , I was wanting to know if you could write a litte more on this topic? I’d be very thankful if you could elaborate a little bit further. Kudos!

  4. Just want to say your article is as astonishing.
    The clarity in your post is just spectacular and i can assume you are an expert on this subject.

    Fine with your permission let me to grab your feed to
    keep updated with forthcoming post. Thanks a million and please
    keep up the enjoyable work.

  5. Great article, love all the screenshots on how to get this done. Wondering if it might be easier to use a document tracking tool to share the PDF instead? This way you’d be able to embed the link within your website, and collect all the download metrics plus page-by-page viewership metrics without having to create so many custom events.

Leave a Reply

Your email address will not be published. Required fields are marked *

You cannot copy content of this page