Button click tracking with Google Tag Manager (2023) || Track clicks with GTM

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if you have buttons on your website you need to track if visitors are clicking them that way you will know if users are engaged and if they are interested in your offer in this video i will show you how to track buttons with google tag manager and we will send those events to google analytics for also i will show you how to see collect data in ga4 reports on this demo website i have this button and let's say that i want to track when someone clicks it and i want to send that event to google analytics for to get started first you must have google tag manager installed on a website and in that google tag manager container you must have installed google analytics for if you have no idea what these things are then i will post two tutorials in the description of this video where i explain how to install gtm and ge4 so before you continue make sure to watch those first but if you have already done this then let's continue now let's check what can we track with eagle tag manager when it comes to that button so click preview in google tech manager then enter the url of the page where you want to track the button and click connect once tag assistant or in other words preview mode has connected click the button now i will go back to the preview of google tag manager and unfortunately i don't see anything related to clicks that is happening because by default google tag manager has not enabled any click tracking features that is why we have to go to google tag manager click triggers click new then click trigger configuration and select all element clicks leave all settings as they are at least for now and then let's name this trigger all element clicks click save also go to variables and make sure that you have enabled click variables right here such as click id click classes and in my case i don't see those variables that is why i will click configure and we'll click checkboxes next to every click variable right here now when you do that click preview again to refresh the preview mode click continue go back to the website and click the button once again now i will go back to the preview mode and here i see the click event right here i can click it i can go to variables and i will see some data about that click click classes is empty but i have click id i have click text which is big call to action button in this case and now i need to use some clicker related variable that will help me make my trigger in google tag manager more specific because right now the trigger tracks all element clicks but i want to track only those clicks that happen on the call to action button right here so let's take a look at the preview mode click classes is empty click element is too advanced so we won't use that right now and then we have click id so if you have some value in click id this is a pretty good variable to use in a trigger i don't recommend using click text because text can change in the future or maybe a visitor can land on your website and use the built-in translation feature which will change the text so instead out of these variables i would suggest using the click id so let's go to google tag manager triggers and let's edit our existing all element clicks trigger click it then click on the pencil and then switch to some clicks now let's choose click id and click id must contain or it might equal to the value which is this one right here keep in mind that on your website these values will be different in your case maybe you won't have click id maybe you will have click class which might still be unique enough and if you don't have any useful values right here then you will need to use a more advanced solution which is called css selector and click element and i teach how to do that in another tutorial and i will post a link to it below the video so in that tutorial we go from beginner stuff to a bit more advanced stuff in the current video that you're watching i'm focusing only on the usual beginner stuff so once you copy your click id then go back to google tech manager and paste that id right here then rename the trigger to something like click call to action button or you can add something more specific and click save now it's time to send that click information to google analytics for and i mean information such as click text for example so let's go to tags new and then click on tag configuration and finally select ga4 event here you will need to select your existing google analytics for configuration tag and here you can enter the event name it can be anything you want and in this case i will name it something like cta which is called to action click and also i will send an additional parameter because i have that in google tag manager i see that we can use click text so basically i can send this text to google analytics 4 and then see that in the report because maybe over time the text will change so i can see how different text impacts the user behavior so let's go to event parameters and when it comes to click text there is a recommended parameter in google analytics for and that parameter is called link text exactly like that all lowercase and with the underscore and here we can insert the variable that returns the text of a button and it is called click text so click the button to insert the variable and then select click text that's it for the configuration now let's select the trigger or in other words the moment when we will send this event and that moment is when the click event occurs which is right here and click id contains this we have already created that trigger several minutes ago so let's click on this section and then select that trigger finally let's name this tag i usually name it like that ga4 event and then the name of the event which is cta click click save and let's test everything click preview this will refresh the preview mode click continue then go to the website and click that button now i will go to the preview of google tag manager click that click event and i see that my tag has fired and it fired successfully i can click it and i can see even what kind of information was sent and to which property now let's go to google analytics 4 and test if this event was received properly in google analytics 4 go to configure debug view and then you should see that event somewhere in this stream click on that event and you can then expand the link text and you can see the text of a button once you made sure that everything is working properly and you see that event in the debug view it's time to publish your changes so click submit then add some version name like call to action button tracking with ge4 and click publish from this moment this kind of tracking went live to all the website visitors and then after 24 hours you will be able to see that event in reports of google analytics for by going to engagement events and then you will see that event right here the reason why i don't see that is because not enough time has passed and i still need to wait for 24 hours now let's say that you have multiple call to action buttons being tracked by google analytics 4 and their text can also be different and you want to see which text is clicked the most to see that you can build a custom report in google analytics for so let's go to analytics then explore then select blank and then in dimensions click plus now let's add several dimensions so we will need the event name we will also need the link text because that's the parameter that we sent together with the event click this one and click import then in the metrics you can add things like total users or at least select event count right here and click import now let's build a report drag link text to rows drag event count to values and then you will see several values already the reason why i see this one is because again still not enough time has passed to see the call to action text and the report actually just several minutes have passed so now i will show you a similar example but i will be using a different event it will be not the call to action button click but it will be the menu link click but the principle will be very very similar so when you start seeing a report that looks like this you will notice that the first row is empty this happens because all these other events they don't have the link text value because those events might be things like scrolling maybe purchase maybe something else so we want to exclude this and see the button text instead so to do that you will need to create a filter and narrow down only two button click events so click anywhere right here select event name and then enter the name of the event that exactly matches your button click event but again in my case i will be using a different event because just several minutes have passed since i configured button click tracking and right here you will see the event probably just after 24 hours so instead i will be using a different event which is called menu link click because i tracked menu link clicks with these ones right here so here i will just enter menu link click but in real situation i would have entered cta click because that's the event name i sent to google analytics for so once you do that click apply and now this report will be narrowed down only to those particular events and you can see how many times was the button clicked with different texts and then you can see all right three times the button was clicked when its text was subscribed and then one time that button was clicked when its text was blocked and that is how you can track clicks with google tag manager buttons on websites are coded in different ways so if this tutorial did not help you then check the description of this video where i share some additional tips if you found this video useful hit the thumbs up button that will help me understand what videos do you like and what should i create in the future also if you want to learn more about google tag manager or google analytics 4 then consider subscribing to this channel my name is julius this is analytics mania and i'll see you in the next video [Music] you
Info
Channel: Analytics Mania - Google Tag Manager & Analytics
Views: 11,561
Rating: undefined out of 5
Keywords: google tag manager, gtm click tracking, button click tracking, google tag manager event tracking, button tracking google tag manager, tracking buttons google tag manager, button click tracking google tag manager, gtm click trigger, google analytics clicks tracking, track clicks with google analytics
Id: ghUwerH1fsw
Channel Id: undefined
Length: 11min 22sec (682 seconds)
Published: Tue Nov 01 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.