I am looking for some advice on Google Tag Manager click events.
Our client has requested that a certain click should be captured as gtm.linkClick event. However, the element in question is a button that will trigger routing within an Angular Application. This button click is being captured as gtm.click.
My question is, does that matter? Will this provide less information or can I configure GTM tags to grab the same information?
In GTM a click-based trigger has two options: if you want it to only listen for clicks on regular links ("Just Links" option) or for clicks on any HTML element on the page ("All Elements" option).
gtm.linkClick event is Click - Just Links trigger type in GTM
gtm.click event is Click - All Elements trigger type in GTM
If user is clicking to <a> HTML tag, it's firing gtm.linkClick event, in other case, if user click in other any html tag(buttons,images,span, divs and etc), it will fire gtm.click
One tricky moment.
You might want to track click on complex <div> which contains child elements. gtm.click might fire on children html tags.
For example if you have markup
<div id="parent">text <span>child1</span> and <div>child2</div></div>
And you want to crack clicks on #parent div. In this case, better way to do that is to have trigger condition
Click Element - matches CSS selector - `#parent, #parent *`
It will trigger if click will happen on #parent div or in one of his child
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With