You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 30, 2023. It is now read-only.
Problem:
We have a project using React and Elm. The enableLinkTracking function for React just works nice.
But for ELM (external) Javascript this doesn't work out of the Box.
Reviewing the MatomoTracker Code I just found the trackEvents() Method that is querying the DOM for data-matomo-event attributes.
However, for a reactive App we can not make use of this function as the DOM is not static.
But we like the approach to simply add a custom attribute to enable event clicking.
Solution:
To support custom attributes (data-matomo-event) on a frequently changing DOM, I think using a
MutationObserver would be a good solution dynamically add a Click-eventHandler on elements featuring a data-matomo-event attribute.
What do you think?
Are there alternatives I've missed?
The text was updated successfully, but these errors were encountered:
Problem:
We have a project using React and Elm. The enableLinkTracking function for React just works nice.
But for ELM (external) Javascript this doesn't work out of the Box.
Reviewing the MatomoTracker Code I just found the trackEvents() Method that is querying the DOM for data-matomo-event attributes.
However, for a reactive App we can not make use of this function as the DOM is not static.
But we like the approach to simply add a custom attribute to enable event clicking.
Solution:
To support custom attributes (data-matomo-event) on a frequently changing DOM, I think using a
MutationObserver would be a good solution dynamically add a Click-eventHandler on elements featuring a data-matomo-event attribute.
What do you think?
Are there alternatives I've missed?
The text was updated successfully, but these errors were encountered: