There can be many “call to action” buttons like contact us, download, learn more. Let’s track them for clicks using Google tag manager. In this article, I will walk you through tracking clicks on such buttons I have used in my blog post. You can use the same process for any links in the navigation, banners or content.
So, let’s begin with setting up tracking for button clicks using Google tag manager.
You should be aware of Google Tag Manager Lingo. Moreover understand what a trigger, tag, and the built-in variables available are.
The next is, you should have a Google Tag Manager for tracking site’s traffic in Google Analytics though it isn’t a must. We will still need to have the Google Analytics Property ID to send scroll depth data to Google Analytics.
If you aren’t sure, refer to my article – How to Connect Google Analytics With Google Tag Manager first and then continue with this article.
Next, we will find the class for the buttons.
Navigate to the URL where the button is. I will be tracking the “Check out this Book on Amazon India” button as shown in the image below from the article 10 Best iOS App Development Swift Programming Books.
To track button clicks, we will need either the HTML button ID or CSS class for the button. One can use the HTML code inspector to find any elements ID or class.
My button class is “button primary“. I will be using this button class in the trigger.
Note: If you wish to use Click Classes > equals then you should be using the complete class for the button which in our case is “button primary”.
Event Tracking Parameters
Let’s preview the tag now using the Google Tag Manager’s debug mode.
As I click the download button the debug window will show the tag being fired.
Sign in to your Google Analytics account and click Behavior > Events > Overview.
It will show the event category we have added for the tag. It is “Button Clicks”.
Under the “Button Clicks” event category, we will see the event label with all links are getting clicks. Under Action all the pages where the links were clicked.
Also, check out How to Track External Link Clicks and Affiliate Link Clicks Via Google Tag Manager.
Free Google Ads Tutorial for an absolute beginner covering campaigns and their types, networks, keywords,…
Do you want to make money programming in Java? Here are 6 creative ways for…
9 smart ways for freelancers to achieve financial freedom. First, you have to believe it…
With so many programming languages and resources available, it can be information overall to learn…
Wise review from an Indian freelancers point of view to receive payments in India. How…
There are 3 types of clients who want you to lower the price. How to…