gdpr-cookie-notice icon indicating copy to clipboard operation
gdpr-cookie-notice copied to clipboard

Cookies settings behavior

Open gregBerthelot opened this issue 6 years ago • 9 comments

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

gregBerthelot avatar May 28 '18 11:05 gregBerthelot

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 :)

passatgt avatar May 28 '18 13:05 passatgt

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

gregBerthelot avatar May 29 '18 13:05 gregBerthelot

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.

passatgt avatar May 29 '18 13:05 passatgt

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

gregBerthelot avatar May 29 '18 14:05 gregBerthelot

Maybe those are created under a different domain?

passatgt avatar May 29 '18 17:05 passatgt

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.

gregBerthelot avatar May 30 '18 06:05 gregBerthelot

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 :slightly_smiling_face:.

ADmad avatar Oct 13 '20 08:10 ADmad

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 avatar Feb 24 '21 09:02 Danniemite

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!

Danniemite avatar Feb 24 '21 10:02 Danniemite