How can I detect a click on the specified element by using the "Click Element" variable in Google Tag Manager?
<a href="https://amazon.in/product-id" target="_blank" class="amazon-btn">
<div>
<span>BUY NOW AT</span>
<div class="amz-logo"></div>
</div>
</a>
I've set up this trigger:
Click - All Elements -> Some Clicks -> Click Element -> matches CSS selector -> *.amazon-btn*
https://i.sstatic.net/ipsLy.png
The trigger doesn't activate when clicking on the element.
This is the click element displayed in the debug window:
'HTMLDivElement: html > body > section.content.looking-sec > div.container > div.row > div.col-md-6.looking-cont > div.btn.btn-custom.btn-top.hide-small > a.amazon-btn > div'
https://i.sstatic.net/LNfpM.png
I also attempted to use
Click Element -> contains -> amazon-btn
, but it didn't work either.