Set up Event Tracking using Google Tag Manager
In my previous three articles, we have learned how to implement Google Tag Manager, added Google and Facebook Pixel tracking code and Set up conversion tracking. Today, I am going to show you how to set up event tracking.
What is Event Tracking
It is to track any interaction or activity that users do on your site. such as a mouse, keyboard, frame and form events.
These interactions can be
- Download a file
- Scrolling down the page
- Viewing of video
- Form field
- Clicking a button
Why do we need Event Tracking?
By default, once you have set up Google Analytics (GA) properly, it will start tracking pageview when users visit your site. But still, some of the events are not trackable unless you tell GA to do so.
What are some of the events not trackable?
Some of the events not trackable are
- click to an external link
- downloading a file
- viewing of video
- scrolling of a page
- clicking a button, etc.
Google Event Tracking
- Login to your Google Tab Manager account.
- Click on the “Variables” on the right and click “Configure”
- In this example, I am going to track clicks, so I will only check all the clicks checkbox. If you need to track other items, do check the necessary boxes and close it after you are done.
- Click on the “Tags” and click “New”.
- Give it a proper name and click the Tag Configuration section.
- Select Google Analytics: Universal Analytics.
- Under Track Type, select Event.
- Under Event Tracking Parameters,
for Category, name it “Click”,
for Action, name it “sitemap”.
- Under label select “page path”. When a user clicks on the link, this label will auto track at which page the user clicks the link.
- Under Google Analytics setting select your Google Analytics ID. Then click on the Trigger section.
- Click add.
- Give this trigger a proper name and click on the Trigger configuration section.
- Under Click, “Click all Elements”.
- Under “This trigger fires on”, check “Some Clicks”.
The first dropdown box, select Click URL.
Second dropdown box, select contains.
Last dropdown box, type in sitemap.
- Save again.
- Click submit.
- Give a proper name and description of this version and publish it.
How to check if your trigger is working
For my example, I will go to my site and click on the sitemap link.
Go to your Google Analytics, under Realtime -> Event, you can see that your data is logged.
The very next day, go back to your Google Analytics, under Behavior -> Events -> Overview, your data will be log there.