New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Outlink tracking when DOM modified #17522
Conversation
build js |
and fix test
build js |
I see how this works, using the root element to always handle clicks (and it's definitely simpler), but I think there's potentially an issue if event bubbling is cancelled (ie, via stopPropagation()) somewhere along the way. In that case we might not track any outlinks. Is this something we want to handle @tsteur? |
@diosmosis that's something we can't prevent but we set the third parameter in addEventListener to From https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
it basically starts in the html/body elements and then goes down before it would bubble up again AFAIK. And usually someone might stop propagation only at a later stage (they have default useCapture=false). It works quite well eg in TagManager etc and it shouldn't be a problem |
Tested locally, works well. Created matomo-org/test-examples#7 for testing. Also left one small comment, otherwise looks good. |
fyi because the 4.3 release is soon and the RC is already out we might want to merge that one only after the 4.3 release just in case anything is breaking etc. And then we could directly update the SPA guide etc to mention the method no longer needs to be called etc |
@tsteur should we change the milestone? |
Changed it for now 👍 Hoping it won't be later renamed to 4.5.0 after releasing 4.3. Then we would change the milestone again. I could create a 4.3.1 milestone but there we'd mostly want fixes and not changes in there. |
build js |
Description:
fixes #15780
Review