I am currently configuring Google Tag Manager for a client's website and encountering difficulties in getting click event tags to activate.
Although I have set the trigger to activate based on the button's CSS selector, the actual button contains several child elements, including an svg icon. Surprisingly, when the svg is clicked, the data layer records the click but the tag fails to activate. The tag only activates when the button itself is selected.
In an attempt to resolve this issue, I even removed event listeners from my own scripts that were connected to these buttons, thinking that perhaps a return false;
or e.stopPropagation()
was obstructing the process, but unfortunately, this did not yield any positive results.
My understanding was that GTM is designed to detect click events that propagate up to the document. If this assumption holds true, shouldn't my tag activate even if a child element is clicked? Or could it be possible that I am misinterpreting something?
On another note, would it be more effective to push the event to the dataLayer through my scripts instead of relying on a click trigger?
10 gtm.click
successfully triggered the tag
9 gtm.click
refers to the child svg element that failed to do so
The screenshot at the end displays the activation rule for my trigger.