Using ASTRA Firewall

Compliance types in GDPR Cookie Consent Tool

There are three compliance types you can select from in the GDPR Cookie Consent tool:

1. Informational

You tell your users that you use cookies, and that by continuing to use your website they accept them. This is the default compliance type, and the easiest approach for website owners to implement as it does not require any code changes. It provides your users with no direct control over cookies, other than through their own browser settings.

2. Opt-out

You tell your users that you use cookies, and give them one button to disable cookies, and another to dismiss the message. This compliance type will require you  to modify parts of your site that use cookies to disable them when so instructed.  If a user does not choose to disable cookies, they will continue to work as normal. You would have to modify parts of your site that use cookies to disable them on a JS ‘callback’.

3. Opt-in

You tell your users that you wish to use cookies, and give them one button to enable cookies, and another to refuse them. No cookies are used unless the user expressly chooses to enable them. You would have to modify parts of your site that use cookies to disable them on a JS ‘callback’.

 

JavaScript Callbacks for Opt-out and Opt-in compliance type

 


<script>
window.cookieconsent.initialise({
container: document.getElementById("content"),
palette:{
popup: {background: "#fff"},
button: {background: "#aa0000"},
},
 onInitialise: function (status) {
  var type = this.options.type;
  var didConsent = this.hasConsented();
  if (type == 'opt-in' && didConsent) {
    // enable cookies
  }
  if (type == 'opt-out' && !didConsent) {
    // disable cookies
  }
},
 
onStatusChange: function(status, chosenBefore) {
  var type = this.options.type;
  var didConsent = this.hasConsented();
  if (type == 'opt-in' && didConsent) {
    // enable cookies
  }
  if (type == 'opt-out' && !didConsent) {
    // disable cookies
  }
},
 
onRevokeChoice: function() {
  var type = this.options.type;
  if (type == 'opt-in') {
    // disable cookies
  }
  if (type == 'opt-out') {
    // enable cookies
  }
},
location: true,
});
</script>

 

 

Was this helpful?