Google Analytics is an incredible tool for sure. However, there’s still data that you can’t record in Google Analytics. What will you do in such a case? This is where you need to get a hang of Google Analytics event tracking.
Google Analytics Event tracking is a very useful feature that enables you to record interactions with all the things in your website that cannot be tracked as standard in Google Analytics.
Things like understanding how long users spend on your site, different things they do, and which forms do users mostly land at are all recorded with the help of this tool. You just have to add snippets of code to your site to get going.
This blog talks about manual event tracking through coding on your site as well as the automatic approach – Google Tag Manager.
Table of Contents
Uses Of Google Analytics Event Tracking
We will shed light on how to set up event tracking, but before that let’s first look at the several ways Event Tracking can be leveraged to measure visitor engagement on your site. Generally, event tracking is used to:
- Note all the clicks made on unique parts of a page, which includes all the call to action buttons found in the blog section or in the contact us page.
- Collects data about the number of users who filled and submitted the form on your site.
- Track all media downloads the users have made
- Track and measure the number of users who clicked on mailto email addresses or on click-to-call phone numbers. This is a very useful feature as it helps you understand the amount of traffic coming from the website.
- Track outbound link clicks to other websites.
- Track the number of interactions done with video and media content, like time spent on watching a certain video.
Moreover, event tracking also enables you to measure interactions other than loading another page on your website. You can easily set up your Google Analytics based on your events.
Getting Started With Event Tracking
First things first, before you use event tracking, you need to have Google Analytics installed on your website. You can do this by putting the code on every page of the site. If you’re not very good with the codes, you can add Google Tag Manager code to your site and go on to configure Google Analytics tags and triggers and variables.
All set to start with event tracking? You need to wait a little more here. It’s highly important to consider the following things before you jump into event tracking:
- After the recent updates, there are two versions of the Google Analytics tracking code available. You must check if you’re using the older universal Google Analytics (Analytics.js) code or the modern version gtag code (gtag.js) before you apply any code. If you have the older version, it’s better to migrate to the newer one as this is made to tackle the Intelligent Tracking Prevention (ITP) that disallows cookie data in browsers.
- Be sure of which method you want to follow; the manual tag linking or the auto-event tagging on your site. If you have a large website and you have tons of documents and page elements to track, go for the auto event tagging option. The Google Tag Manager Events tool will be of great use.
- While setting up event tracking, make sure you have a very clear naming convention for every different action, label and category option that are available. Know that the names you assign to every action, label, and category will be shown in the event tracking reports. If the naming isn’t done strategically, you’ll have a very hard time interpreting the report later on.
- Know which elements of your site need tracking. For instance, some set up tracking for PDF downloads while others do it for clicks on outbound links.
How Does The Google Analytics Event Tracking Work?
Let’s now jump to the real part – how does the tool work?
In simple terms, you add a snippet of the custom code to the link code on all the items you want to be tracked on your website. Once this is done, whenever these items will be clicked, the element will be tracked and shown as an event in Google Analytics.
The event tracking code has four major elements. These 4 elements explain how a user interacts on your website:
- Google Analytics Event Category: This is a required element. The category is basically the name you assign to all the objects you want to track.
- Google Analytics Event Action: Required element. This can be any form of interaction like clicking on a button or downloading a document.
- Google Analytics Event Label: An optional element. Labels are assigned to various events. For instance, clicks on the menu options is an event.
- Google Analytics Event Value: An optional element. You may use this if you wish to give a numeric value to any of your file downloads.
Whenever something happens on your site, these 4 elements mentioned above will enable you to understand how the user has interacted with your page. With that said, it’s very important to put in the right amount of effort and time in naming conventions for these attributes as this is what will show in Google Analytics.
Manual Tagging Of Links To Track Events
You have the option to manually customize links on your site and add the Value, Category, Label, or Action attributes to the link.
Let’s familiarize you with a Google analytics event example of manual tagging that records the download of a company brochure PDF document:
<a href=”www.examplewebsite.co.uk/pdf/company_brochure.pdf” onclick=”ga(‘send’, ‘event’, ‘PDF’, ‘Download’, ‘Company Brochure – PDF Download’);“>Download Our Brochure</a>
There are 4 steps to follow when you manually tag links to track events. Read here.
Auto-Event Tracking: Using Google Tag Manager
Google Tag Manager has proven to be an incredible tool for measuring interactions on your site.
The process can be quite confusing for beginners, but you’ll get the hang of it once you understand the basic rules of tags, triggers, and variables.
Event Tracking through Google Tag Manager starts when the user clicks on event triggers that you’ve set up on particular variables on your page.
The GTM platform takes data on your website and passes it to other platforms like Facebook Analytics and Google Analytics and this won’t require a lot of backend coding from your end.
Therefore, you won’t have to manually write code on the back end when you update and add tags on your Google Analytics, saving you tons of time in the long run.
For instance, you need to learn how many users downloaded a certain PDF from your site. If you’re going to do it manually, you will have to alter all the download links in all areas of your website.
Conversely, if you’re using Google Tag Manager, you can simply add a new tag that tracks the number of downloads.
Let’s list down the necessary steps you can follow to make your event tracking simple.
Step 1: Setting Up GTM
Once you’ve created your account on the Google Tag Manager dashboard, add your account name that reflects your business. Choose your country and choose if you wish to share your data with Google, and hit on the ‘continue’ button.
You’ll now move to another page where you will set up the container. This container is a bucket that has all the macros, rules, and tags for your website.
Assign this container a name and choose which type of content (Web, iOS, Android or AMP) you will associate with it.
Click ‘create’ to read the Terms of Service, and after you’ve agreed to the terms, you’ll see the container’s installation code snippet.
Copy and paste the 2 snippets on every page of your website. The instructions will guide you about where to put the codes.
Wish to make this even simpler? Install and activate the Insert Headers and Footers Plugin. This plugin will enable you to add any script in the header or footer throughout the website.
Step 2: The Built-In Variables
Enable the built-in variables you will find in GTM to create tags.
Click on “Variables” on the main dashboard and then click the “configure” button on the top right side of the page.
Now, you have the option to choose all the variables that you want to be tracked. Put the tick box on all the variables you want to be tracked. This brings us to the next step:
Step 3: Creating Tags
On the GTM dashboard, click on the “Add a new tag” button. This will take you to another page where you will create your new website tag. You can customize two areas of the tag:
- Configuration: the place where all data collected by the tag will accumulate
- Triggering: the type of data you want to collect.
Click on the “Tag Configuration button” and choose the type of tag you want to create. On top of the list, you’ll find the “Universal Analytics” option. Choose this to create a tag for Google Analytics.
You can now choose the type of data you want to be tracked. Go to “Google Analytics Settings: and click on “New Variable” from the dropdown menu.
Enter your Google Analytics tracking ID on the new page. Now, all your website data will be sent into Google Analytics for you to see later.
Go to the “Triggering” section and select the data you want to be sent to Google Analytics.
Want the data to be sent from all the pages of your site? Click on the triggering button, and you’ll land on the trigger page. Here you may click on “All pages” to have all the data of your website sent to Google Analytics.
Finish it up by clicking save and voila! Your Google tag tracking is set. You can now view all the data of your website from your Google Analytics.
Wrap Up
Once you’ve set up the event tracking system, you can now conveniently get a complete picture of your website and target audience.
This will definitely help you run better campaigns, create content that’s more likeable, improve features on your site, and ultimately improve your overall business.
Think you need help with this? Get in touch with Digiown today and have our experienced webmasters, developers, and SEO experts help your digital business rank on top.