Link click might not be counted under circumstances in Matomo #15528
Labels
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone
If for example a user has it's own onClick listener on an element, and calls either
stopPropagation
orpreventDefault
, 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 outdatedhref
. 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-phasesNot sure if there is already an issue about links that maybe weren't tracked sometimes.
The text was updated successfully, but these errors were encountered: