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
Fix for opt-out toggling on page load and incorrect default state #19915
Conversation
…t state if no cookies found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function test on that one works as expected, but there are lots of UI tests failing that seem unrelated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Functional review done
- Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
- Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
- Security review done
- Wording review done
- Code review done
- Tests were added if useful/possible
- Reviewed for breaking changes
- Developer changelog updated if needed
This pull request has been mentioned on Matomo forums. There might be relevant details there: |
Customer's request: Good morning, I am a Matomo Cloud customer. I would like to report a bug about the code you provided with the opt-out js (from the Matomo backend). When I visit the page where the form is present and then I refresh, the data is changed automatically (example: once it is checked, the next time it is not and so on). Link where the form is present and the bug can be reproduced: https://drapersitaly.it/it-it/cookie-policy/ |
@KarthikRaja1388 can I convert the comment to an issue ticket? |
@peterhashair sure |
This PR should fix that problem once it's released, not sure we need a new issue for it? |
Description:
Fixes #19888
Fixed #19879
The JavaScript tracker opt-out was setting the current opt-out state on page load which was incorrectly causing the state to toggle, this bit of code has now been removed.
The standalone opt-out was interpreting no 'consent cookie' or 'remove consent cookie' to mean the user was opted out, which is incorrect. An extra check has been added so that if neither the 'consent cookie' or the 'remove consent' cookie are set the the user is considered to be currently opted-in.
Review