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

Consent reset does not automatically remove Google Analytics cookies #5

Open
eldIsher opened this issue Jul 1, 2023 · 2 comments
Open

Comments

@eldIsher
Copy link

eldIsher commented Jul 1, 2023

@cookieconsentbutton('reset') opens modal, but clicking 'Only essentials' does not clear Google Analytics cookies. It only (re)sets the consent settings

README.md says this one

generate a button that will reset the user's cookies and show the consent modal again.

it is not now resetting cookies. Google Analytics cookies still in browser

@toonvandenbos toonvandenbos changed the title @cookieconsentbutton - reset function not working Consent reset does not automatically remove Google Analytics cookies Jul 4, 2023
@toonvandenbos
Copy link
Member

Hi @eldIsher,

Thanks for reporting this.

Removing the Google Analytics cookies will mess with the analytics data if the user decides to accept them again after the reset. However, I guess we should indeed remove the cookies set by Google Analytics in this scenario.

There doesn't seem to be a straightforward official way to do so. Google Analytics has a tendency to change their cookie names every now and then (sometimes during a major version's lifetime if I recall correctly), I'd rather have an official JS method to remove all used cookies at once rather than having to make wild guesses in the package's backend...

What's your take on this?

@eldIsher
Copy link
Author

eldIsher commented Jul 5, 2023

hi @toonvandenbos

thanks for your response. I do not know it will mess with googleAnalytics when is removed. Is there official statement from google?

Remember to update App/Http/Middleware/EncryptCookies.php if you change cookie from JS because cookie is encrypted. It is empty if changed from browser, backend cannot read it. Make it unencrypted to make it work.

If cookie name changes this package needs update anyhow, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants