Tracking outlinks in shadow dom

I’m trying to track outlinks that are in a dynamically-generated element in a shadow DOM.

For other dynamically-generated content I just run _paq.push([‘enableLinkTracking’]) after the content is generated, but in the case of the shadow DOM element this is not working.

The click event is properly bubbling up to the document level, so I could listen for clicks at the document level and then read the path property of the event. But apart from being wasteful, this solution doesn’t work in Edge nor IE.

Modifying the application code is out of the question. The goal is to have the analytics code separated from the application code.

Have you had this kind of problem?

1 Like