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

Cookies settings behavior #10

Open
gregBerthelot opened this issue May 28, 2018 · 9 comments
Open

Cookies settings behavior #10

gregBerthelot opened this issue May 28, 2018 · 9 comments

Comments

@gregBerthelot
Copy link

gregBerthelot commented May 28, 2018

First thanks for sharing the script. I have a question regarding the global behavior. You show the notice if not all categories are enabled

    if(notAllEnabled) {
      showNotice();
    } else {
      hideNotice();
    }

Seems weird as gdprcookienotice is part of necessary cookies and in this case if user decline all other categories, notice should not be shown again. BTW you have add the ability to trigger the modal with custom button using gdpr-cookie-notice-settings-button class on any element.

Thanks to clarify why we need to allow all categories to stop showing the notice

Greg

@passatgt
Copy link
Owner

Hi! We keep the notice visible if the user does not accept all the cookies on the site, just to "force" them a little to accept it :) If the user does not want to accept all categories, he/she has to live with non-disappearing cookie bar :)

@gregBerthelot
Copy link
Author

Make sense, thanks.

I made a test on your nold.io website and it seems that even if I uncheck all cookies categories and save settings, all __utm cookies are written. Is it normal behavior?

Thanks

@passatgt
Copy link
Owner

Its just a demo site, not properly configured i guess. You need to add all cookie names you want to delete and on the demo page, __utm is not in the config.

@gregBerthelot
Copy link
Author

It works fine for some cookies but not for all. Despite the add of analytics: ['__utma', '__utmb', '__utmc', '__utmt', '__utmz', '__atuvc', '__atuvs'], they are not deleted

@passatgt
Copy link
Owner

Maybe those are created under a different domain?

@gregBerthelot
Copy link
Author

They are on same domain that the one set in config. Seems that some cookies are set after the gdprCookieNotice init so they are not deleted. It miss something to make the init only at the very end of page/other script. in some case you can’t add it manually at the end.

@ADmad
Copy link

ADmad commented Oct 13, 2020

I would be nice if this behavior was configurable and have the cookie bar disappear (and not reappear) once user has saved the settings, for those who don't want to constantly nag their visitors to accept all cookies 🙂.

@Danniemite
Copy link

Danniemite commented Feb 24, 2021

Hi! We keep the notice visible if the user does not accept all the cookies on the site, just to "force" them a little to accept it :) If the user does not want to accept all categories, he/she has to live with non-disappearing cookie bar :)

I am sorry to say this, but I believe this is an unethical behaviour. Why forcing anything in this subject? The world is loud from the topic of selling visitors as products to companies like FB and Google. Why is it a problem if the user doesn't want to share their data? This is a basic human right.

Anyway, thank you for sharing this code, but please reconsider it's behaviour.

And the cookie deletion also not working after changing your preferences.
These would be so small modification to make this awesome plugin perfect. I hope you will do this. Thank you.

@Danniemite
Copy link

Danniemite commented Feb 24, 2021

I could solve the cookie deletion manually:

function delete_cookie( name, path, domain ) {
        document.cookie = name + "=" +
        ((path) ? ";path="+path:"")+
        ((domain)?";domain="+domain:"") +
        ";expires=Thu, 01 Jan 1970 00:00:01 GMT";
}

document.addEventListener('gdprCookiesEnabled', function (e) {

        if(e.detail.analytics) { //checks if marketing cookies are enabled
               //add you own analytics code
         }
         else{
                // set cookie deletion manually here, for each of your analytics cookies
                // for example:
                delete_cookie('_ga','/', 'yourdomaingoeshere');
                delete_cookie('_gat','/', 'yourdomaingoeshere');
                delete_cookie('_gid','/', 'yourdomaingoeshere');
          }
}

// same for marketing cookies

set this BEFORE calling the gdprCookieNotice({...}) function!

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

4 participants