Do you have a blog, publish whitepapers or ebooks, and do you use images from Jumpstory as well? If you do, you probably already spend a lot of time producing content for your website. You might want to know how many users are downloading your content.
By tracking your downloads, you will be able to figure out what content your visitors like the most and adapt or improve your visuals accordingly.Google Analytics doesn’t do download-tracking “out-of-the-box”. In other words, you have to tell Google Analytics that you want to track this. There are various methods to do this. One of them, I will guide you through today, using Google Tag Manager.
In this post you will get a step by step guide to setup download tracking on your website, using Google Tag Manager and Google Analytics.
What is Google Tag Manager?
In short, Google Tag Manager is a one-stop for all of your tracking and scripts on your website. You can easily implement, test, pause, stop and start new and existing tags, saving you time and money on developers.
Google Tag Manager is the industry standard for managing all the scripts and tags running on your website. If you haven’t migrated your tracking into Google Tag Manager, you seriously should consider doing this.
Tracking downloads using Google Tag Manager
Google Tag Manager is often my go-to tool for tracking everything on a website, and download tracking is no different. I prefer using GTM because tracking is easy and fast to set up, making it possible to test tracking before going live.
If you have set up Google Tag Manager on your website, all you need to do is:
- Active the built-in variable for clicks,
- set up a trigger, and
- attach the trigger to a Google Analytics event tag
Let’s dive straight into it.
#1 Activate variables for clicks
The first step for tracking downloads is to activate the built-in variable for Click URLs. Like your blog, e-books or whitepapers have a specific URL (i.e. yourwebsite.com/your-ebook.pdf), we have to tell Google Tag Manager that we want to track these specific URLs or file extensions in the data layer.
To do this, you have to open Variables and enter Configure in Built-in Variables. Here you need to scroll down do find check of Click URLs. Once you’ve done this, you’re ready for the next step.
#2 Configure your download-trigger in Google Tag Manager
So, now you’ve configured GTM to ‘know’ that do you want to track Click URL’s, next you have to create a trigger to fire on an event based on your file extensions.
To create a trigger, enter Triggers and enter New. Here, select the Just Links-click trigger. To configure the trigger, check off the boxes “Wait for tags” and “Check Validation”. Without going into too many technicalities, the checkboxes make sure that the trigger isn’t fired until the file is 100% downloaded.
Next, you want to enable this trigger when page the Page-URL ‘matches RegEx .*’. This makes sure, that your tag fires on all pages of your site.
Finally, you can configure the file extensions, which you want your trigger to fire upon. I started by stating that you can track downloads e-books, images or whitepapers, but if you want to track mp3-downloads from your podcast, you can do this as well; all you have to do, is to add the file extension to the trigger.
To tell the trigger to fire on these extensions, you have to type the following (.\pdf|jpeg|mp3). If you want to add more file extensions such as .gif, .png, and so on. Basically, just add more file extensions.
#3 Configure your tag for Google Analytics
You’ve configured your built-in variable, you’ve configured your trigger – now you want to connect the trigger to a Google Analytics event tag. With this setup, the trigger will record an event in Google Analytics every time a visitor downloads one of your images or e-books.
Under tags, create a new tag and select Google Analytics Universal Analytics. Next, select Event as a track type.
Under category, you can name this what works best for you, but in this case, I’ve named it File Download. Under action, you can dynamically configure this to show every URL. This way, Google Analytics will show you exactly which URL – and thereby which file extension – the user downloaded.
If you haven’t set up any Google Analytics setting, you can ‘Enable overriding settings in this tag’, and manually enter your tracking ID from Google Analytics here.
#4 Check your new tag in Google Analytics
Once your tag is set up, Google Tag Manager will deliver the data into Google Analytics. To test your new tag, enter Real-time in Google analytics. Here, you can see all of your actions on your website in real-time.
Find one of your .pdf or .jpeg-files, open it in a new tab and check if your new tag fires correctly. Once it does, you will receive an event in Google Analytics.
Google Tag Manager is a highly effective and valuable tool for your event- and conversion tracking. With this guide, you’ve come one step closer to take advantage of the possibilities of GTM and Analytics.