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
How To Setup An Apple Search Ads Campaign
Apple Search Ads has become a huge force in the world of app downloads. Get tips on how to launch a campaign to promote an app!
Adding Facebook Ad Block Lists
Get tips on how to add a Facebook ad placement block list and start blocking your ads from appearing on certain websites.
Optimizing Display Advertising in an Omni-Channel World
We’re teaming up with DialogTech to tell you all about display tactics you can put in place for conversion success, both online and over the phone. DialogTech’s Blair Symes and Hanapin’s Stephanie White will show you the advanced strategies that will have a big impact...
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
Mastering The Transition To PPC Account Manager
Get tips on how to make a successful transition from production associate to PPC account manager.
All You Need to Know to Succeed With CPA Bidding
Using CPA bidding is like living with an unpredictable pet. He’s as likely to bite your guest’s hand, as be a saint.
The End of 2 Ads per Ad Group: Optimized Rotation Means More Ad Variety & V...
With the new rotation settings rolling out on the ad group level, it will be far easier to give it a test!