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

Fix for opt-out toggling on page load and incorrect default state #19915

Merged
merged 2 commits into from Nov 6, 2022

Conversation

bx80
Copy link
Contributor

@bx80 bx80 commented Oct 27, 2022

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

@bx80 bx80 added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Regression Indicates a feature used to work in a certain way but it no longer does even though it should. labels Oct 27, 2022
@bx80 bx80 added this to the 4.12.3 milestone Oct 27, 2022
@bx80 bx80 self-assigned this Oct 27, 2022
@justinvelluppillai justinvelluppillai modified the milestones: 4.12.3, 4.12.4 Oct 27, 2022
Copy link
Contributor

@peterhashair peterhashair left a 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.

Copy link
Contributor

@peterhashair peterhashair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bx80 bx80 merged commit 761029b into 4.x-dev Nov 6, 2022
@bx80 bx80 deleted the m-19879-optout-toggles-on-load branch November 6, 2022 21:44
@MatomoForumNotifications

This pull request has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/global-optout-is-not-working-this-isuseroptedout-always-return-false/47834/6

@KarthikRaja1388
Copy link

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/

@peterhashair
Copy link
Contributor

@KarthikRaja1388 can I convert the comment to an issue ticket?

@KarthikRaja1388
Copy link

@peterhashair sure

@bx80
Copy link
Contributor Author

bx80 commented Nov 10, 2022

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)

This PR should fix that problem once it's released, not sure we need a new issue for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
5 participants