Selecting by CSS does not work with parents?


I have an angular application where I want to track the clicks on a close button, which looks something like this:

<app-icon icon="close">
     //paths etc.

Now I added a click element trigger in the tag manager on the parent of that close icon (matches CSS selector = app-icon[icon=“close”]), but I noticed it oftentimes does not fire.

In the matomo debug logs the click is either registered on the app-icon, the svg, or even some path within the svg. Why is it not always detecting the app-icon click when nothing of the svg is visible outside of it? Is there a solution to this or is the tag manager just not suited for this kind of html?

Hi @Fishy
Your problem seems to be related to: