Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable cookies with cookieconsent by Insites

I don't understand: https://cookieconsent.insites.com/documentation/disabling-cookies/

onInitialise: function (status) {
  var type = this.options.type;
  var didConsent = this.hasConsented();
  if (type == 'opt-out' && !didConsent) {
    // disable cookies
  }
},

What do I have to put instead of "//disable cookies" to disable the cookies?

like image 383
user8028270 Avatar asked Oct 30 '22 07:10

user8028270


1 Answers

I think that you could add something like:

window['ga-disable-UA-XXXXX-Y'] = true;

Inside that section (see here). But it mostly depends your needs and your cookies you set.

Additionally I think that the script could be improved to use

  if (navigator.doNotTrack && navigator.doNotTrack === 1) {
    window['ga-disable-{{GA ID}}'] = true;
  }

So we could use the "Do not track" option in the browser here. Not sure if that is already covered in the Insites CookieConsent script.

P.S. Keep noted that there exists currently a small bug (reported here).

like image 163
BastianW Avatar answered Nov 09 '22 23:11

BastianW