Skip to content
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

Link click might not be counted under circumstances in Matomo #15528

Open
tsteur opened this issue Feb 7, 2020 · 1 comment
Open

Link click might not be counted under circumstances in Matomo #15528

tsteur opened this issue Feb 7, 2020 · 1 comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@tsteur
Copy link
Member

tsteur commented Feb 7, 2020

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.

@tsteur tsteur added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Feb 7, 2020
@tsteur tsteur changed the title Click might not be counted under circumstances in Matomo Link click might not be counted under circumstances in Matomo Feb 7, 2020
@peterbo
Copy link
Contributor

peterbo commented Feb 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

3 participants