Google Tag Manager (GTM) has a built in Click trigger that allows you to trigger GTM tags when the user clicks on stuff.
I believe it does this by adding a 'click' listener on document and then pushing a special 'gtm.click' event into the dataLayer when clicks are made.
In the 'gtm.click' object that is pushed into dataLayer GTM includes certain data pulled from the event.target property, including attributes of the target element such as id/class/href.
Issue is...
If you're using shadow-dom in your html the target/data will be wrong. This is due to the fact that when events bubble up through shadow-dom boundaries they "are re-targeted to look like they've come from the component rather than the internal elements within your shadow DOM".
This can be problematic if you're creating tags/triggers/variables in GTM based on the event target data and you're expecting that target to be the element which the user is actually clicking on (which seems normal).
Is there a solution for this that already exists?