Google Analytics Event Tracking allows you to easily track user events on your website such as clicks, downloads, form submissions, etc and automatically generate event reports and dashboards for analysis. Here’s how to set up event tracking in Google Analytics.
How to Set Up Event Tracking in Google Analytics
Here are the steps to set up event tracking in Google Analytics. There are two ways to set up event tracking in Google Analytics – manually and using Google Tag manager.
How to Set up Event Tracking in Google Analytics Manually
Here are the steps to set up event tracking in Google Analytics.
1. Add Google Analytics to Your Website
If you have not done it already, add Google Analytics to your website. To do this, log into your Google Analytics account.
Go to the Admin section at the bottom of left sidebar. Navigate to the property (website) you want to track.
Copy the tracking code from Google Analytics and paste it in <head> section of your website. If your website is built on WordPress, use plugin like Yoast SEO to set up Google Analytics on your website.
Also, note the tracking code on the Admin page of your web property.
You will need the tracking code to set up event tracking on your website.
Bonus Read : Google Remarketing vs Facebook Retargeting
2. Add event tracking code to your website
You need to add a small piece of event tracking code that is triggered with every user event. It consists of 4 elements
- category – name of the element you want to track (e.g videos, pdf, etc)
- action – type of user action such as click, play, download, etc
- label (optional) – additional information about the event, such as file name, description
- value (optional) – numerical value such as monetary value that you want to assign to each event
Here’s the syntax of an event tracking code, that gets triggered when user clicks an element.
onclick=ga(‘send’, ‘event’, [eventCategory], [eventAction], [eventLabel], [eventValue]);”
Replace eventCategory, eventAction, eventLabel, eventValue with values you want to track. Then place that code in href attribute of the element you are tracking. So it will look something like the following
<a href=”URL_to_track” onclick=”ga(‘send’, ‘event’, [eventCategory], [eventAction], [eventLabel], [eventValue]);”>link text</a>
Here’s a Google Analytics Event Tracking example. If you want to track PDF downloads of your ebook, your event tracking code will look something like
<a href=”https://www.example.com/ebook.pdf” onclick=”ga(‘send’, ‘event’, [PDF], [Download], [Ebook about marketing tips]);”>Download Free ebook!</a>
Now every time someone clicks the link to download your ebook, your website will send event details to Google Analytics which will record and report it in Events page.
Bonus Read : How to Set Up Goals in Google Analytics
3. View Events Report
Google Analytics generates multiple event tracking reports for your website. You can find them under Events menu under Behavior menu, on left sidebar.
There are 4 types of event tracking reports available in Google Analytics:
- Overview – This report gives a complete overview of all event-related information about your website. For example, it will show information such as clicks, interactions with each element being tracked.
- Top events – It displays the top event categories, actions and labels
- Pages – It displays which pages have event tracking enabled
- Events flow – It shows a visualization of how users interacted with your website elements till they triggered an event.
Bonus Read : How Does Google Remarketing Work
How to Set up Event Tracking using Google Tag Manager
Here are the steps to set up event tracking using Google Tag Manager.
1.Set up Google Tag Manager
Log into Google Tag manager and create an account.
You will be guided through a step by step wizard, at the end of which you will get a tracking code that you need to add to your website.
Bonus Read : Types of Remarketing Ads in Adwords
2. Turn on built-in variables
From GTM’s main dashboard, go to Variables on left sidebar, and click Configure.
You will see a list of variables to track. Select all those variables that you want to track.
Bonus Read : How to Create Ad Group in Adwords
3. Create Tag
Click Add New Tag from GTM’s main dashboard.
You will see many tag options which can be configured. Select Universal Analytics
Configure your tag by filling in relevant details such as category, label, action, etc. and click continue.
Next, specify the trigger for your tag whether it is a click, page load, etc.
Save the finished tag.
That’s it! Google Tag Manager will automatically record and report events.