@tsteur opened this Issue on February 7th 2020 Member

If for example a user has it's own onClick listener on an element, and calls either stopPropagation or preventDefault, under circumstances it may prevent our click listener from being executed.

Ideally, we would register our click listeners with useCapture=true ensuring it will be executed before a regular user click listener.

There is one downside that a user could potentially change the href as part of the click event listener and we would be tracking an outdated href. However, this is not guaranteed to work anyway as it depends on what event listener was registered first etc.

Here's a nice explanation of useCapture: https://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/events.html#Events-phases

Not sure if there is already an issue about links that maybe weren't tracked sometimes.

@peterbo commented on February 7th 2020 Contributor

Could also apply to (element-) onFocus (if cancelable), (element-) onBlur (if cancelable), onSubmit, etc., (form, content tracking, heartbeat)

Powered by GitHub Issue Mirror