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 check does not work on Microsoft Edge, Cookies are set without consent!! #60

Closed
flolege opened this issue Feb 11, 2020 · 3 comments

Comments

@flolege
Copy link

flolege commented Feb 11, 2020

On Chrome, no Google (Analytics) cookies are set if the Consent is not given by the pop up click.

On Edge, some cookies are already set although the user did not click nothing yet!

This should not happen, here is a screenshot (am is our session cookie, the others should not be set!)

image

@Mastermindzh
Copy link
Owner

This package doesn't prevent setting any cookies, this just offers you a cookie bar, the rest of the logic has to be implemented by the package consumer.

So I have no explanation why it would be different in the mentioned browsers, I do however know for sure that the cookie-bar doesn't actually stop cookies. (from looking at the code obviously, and issue #58 )

@flolege
Copy link
Author

flolege commented Feb 11, 2020

I see. I am using next.js and in my _document.js Head section i do this:

        {/* Global Site Tag (gtag.js) - Google Analytics */}
         <script
           async
           src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
         />
         <script
           dangerouslySetInnerHTML={{
             __html: `
           window.dataLayer = window.dataLayer || [];
           function gtag(){dataLayer.push(arguments);}            
           gtag('js', new Date());
           
         `}}

I guess this is the culprit. I don't know why chrome does not set the cookie but Edge does. Can I somehow set it based on a condition - e.g. the CookieConsent - cookie is set and true?

@Mastermindzh
Copy link
Owner

I have no experience with next.js nor the google tag manager so I can't be of much help.
If I were you I'd open a ticket on a google tag manager related forum.

Sorry, best of luck,
Rick

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