I need to track clicks on an element that is neither a link nor a button, using Google Tag Manager. I've been able to track links and buttons without any problem, but I can't seem to track these elements.
In the image below I have a ul
that contains several li
. I want to track cliks on the li
elements. Each li
has class="producto-destacado"
This is the code:
<ul class="react-multi-carousel-track">
<li class="producto-destacado">Content</li>
<li class="producto-destacado">Content</li>
<li class="producto-destacado">Content</li>
<li class="producto-destacado">Content</li>
</ul>
(You can view the actual site here )
The way I'm tagging now is by creating a trigger of type "All elements > some clicks" and then "Click element > matches CSS selector >.producto-destacado
I've also tried with "All elements > some clicks" and then "Click ID > Equals >.producto-destacado" and not results either.
*I've also tried the solution posted here , didn't work.
The only solution I found was to wrap my <li>
tags in <a>
tags. That worked for me. Hope this will help someone.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.