Tracking Click Events In Google Tag Manager
June 7, 2017
Google Tag Manager makes tag placement simple. Many users utilize GTM for placing conversion tags but you can track many other page elements as well.
In this article, we’ll tackle a scenario in which we track click events on a webpage. Tracking click events is helpful for sites that don’t have separate confirmation pages. Events are also useful for tracking specific interactions on the site, such as buttons and widgets.
While the example in this article cover clicks, you may utilize the same methods for any page element. The same GTM usability features we covered in the previous article will all carry over to whatever you track.
Adding Additional Information for Triggers
Triggers are necessary for firing tags at the correct time. Many users start with page path triggers. These triggers fire tags on specific pages, such as order confirmation pages. Page paths handle the most basic tag implementations but only scratch the surface for trackability.
What if you want to track other elements on the page?
The easiest way is through listeners. These listeners monitor for specific actions or events on the page. If you want to appreciate this more fully, look up click event listeners and try manually doing this first.
If you happened to look that up and thought, “I hate this” or “isn’t there a simpler way?” you’ll be happy to know GTM will take care of the basics for us!
Although it’s not enabled by default, we can create listeners in GTM with the click of a button.
First, navigate to the variables menu.
Now, click configure under built-in variables. A new menu will pop up and you can now enable whichever elements you need.
For clicks, you will most often use click ID and click class. If there is something else you’d like to use, go ahead and enable it as well.
If this sounds like gibberish to you, don’t worry. These pieces are all standard HTML and we’ll bring it all back together shortly.
Tagging A Click Event
There are only two more tasks to complete once we enable the proper variables. We need to create an event and then we need to create the actual trigger.
Events In GTM
GTM offers integrated solutions for Bing and Google Analytics event tags. This feature allows you to track specific actions across your site. The first step is picking your naming convention for the category, action, and any of the optional parameters.
Then go into the tag menu of GTM and select the GA event Tag or Bing Ads custom event. Fill in the parameters with your preferred values and you are good to go.
If you are using another platform without an integrated solution you can always use the custom HTML tags to implement them. Many platforms will even offer specific directions on implementing their tags in GTM.
Creating The Trigger
Earlier in the article, we enabled the click variables, Now it is time to use them. So far, we know there are certain elements we can use as triggers but how do we find the actual values?
Let’s use an example from PPCHero.com. In this scenario, we want to track users who click the subscribe button and join the email list.
To find the necessary details, we can right click and inspect the element using the web developer tools. The actual look will vary depending on your browser but all offer the same information. If you are using Chrome, you should see something very similar to the screenshot below.
The HTML for the subscript button has the class listed as subBut. We can take that information back to GTM and create our trigger based on the class.
You can do this with almost any element in the page source. Below is what we’d look for if we were tracking users who clicked the load more button.
Once you have everything set up you can preview. If everything checks out, publish your tags and happy tracking!
We covered a basic example in this article. Page tracking and click tracking will take you far. You can even take the same concepts and apply them to form tracking as well as more advanced solutions.
Browse By Category
Update Bids and Monitor Changes with AdWords Scripts
Explore different ways to use Google Sheets and AdWords Scripts to change bids and handle uploads. Get started with creating your own bidding system!
Google Speed Update – What It Means & The PPC Impact
The Google Indexing Speed Update implemented site speed as a SERP ranking factor for mobile web pages. Learn how the update could affect your PPC campaigns.
Dynamic Search Ads for Advanced Users
Explore a few advanced ways to use Dynamic Search Ads in your account!
A bi-weekly newsletter packed full of resources and strategies that will help make you a better PPC expert.
Hanapin Marketing | The PPC Agency of Experts Behind PPC Hero
What is 3rd Party Data and How Do You Use it?
Data is everywhere in online advertising. 3rd party data is an extremely useful way of getting your message in front of the right prospects. But what is 3rd party data and how do i use it.
Launch Your Multi-App Marketing Strategy
Understand what three things you need to know to start your Multi-App Marketing strategy.
Time for an Honest Discussion about RSA's
Join Hanapin’s Matt Umbro and Directive Consulting’s Garrett Mehrguth as they engage in an honest discussion about responsive search ads, walking through all the pros and cons and advice around using the new ad type in your campaigns.
Load More »