How to Track Downloads in Google Analytics Automatically

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 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:

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

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

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

Tag Type: Universal Analytics

Track Type: Event

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.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.

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

Leave Your Thoughts

7 thoughts on “How to Track Downloads in Google Analytics Automatically

Leave a Reply

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