passatgt / gdpr-cookie-notice

Do What The F*ck You Want To Public License
183 stars 70 forks source link

Cookies settings behavior #10

Open gregBerthelot opened 6 years ago

gregBerthelot commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Maybe those are created under a different domain?

gregBerthelot commented 6 years ago

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 commented 3 years ago

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

Danniemite commented 3 years ago

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 commented 3 years ago

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!