Complianz Privacy Suite

Cookies from Complianz

Aert Hulsebos

Aert Hulsebos

Categories

Popular articles

Editing Legal Documents

The legal documents are generated by the Wizard and will show up under ‘Pages’ with a shortcode in the content. This shortcode is used to

Read More

CNIL updated privacy guidelines

While the much-anticipated ePrivacy directive seems to be postponed for some years, local Data Protection Authorities formulate their statements, which provide us with concrete guidelines

Read More
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

It may sound funny, but to handle the blocking of cookies on your site, we use… cookies. Of course these are cookies that won’t store personally identifiable data from users, and are functional, non-track cookies.

  • cmplz_all: user has consented to the marketing level of cookies
  • cmplz_event_*: user has consent to a custom event defined by website owner
  • cmplz_id: non identifiable user id used for A/B testing
  • cmplz_choice: tells us if the user has made a choice or not
  • cmplz_stats: user has consented to the statistics level

Apart from the cookies Complianz Privacy Suite also uses the local storage in a users’s browser to store data for the cookie banner. What you will see when you open the developer tools in Chrome (view/developer/developer tools/application), then look up the local storage from Complianz, is something like this (some html and strings from the banner styling will also be present):

cmplz_user_data:

{“banner_version”:”176″,”version”:”3.0.9″,”a_b_testing”:”1″,”do_not_track”:false,”consenttype”:”optin”,”geoip”:”1″,,”current_policy_id”:”10″}

  • banner_version: to make sure the user has the most recent version of the cookie banner settings, when you change your banner settings this version will get increased. When a users visits your site, we will get served the banner from the local storage, unless the banner version has changed.
  • version: does the same thing, but now only when the plugin has been updated
  • ab testing: this is true when a premium user has a/b testing enabled. Visitors will see different banners then, and banner conversion will be tracked. A-B testing is a premium feature.
  • do_not_track: how to handle Do Not Track signals.
  • consenttype: the type of consent that is required based on your region. Currently we have EU, US, and other regions. Coming soon are UK (after the Brexit) and Canada (Pipeda). These regions will decide if the consenttype is “opt in” (EU, UK), “opt out” (US, CA) or none.
  • geoip: This decides if the consenttype is dynamic, based on the actual region of the user, or if it as the consenttype used by the region where the website’s owner is located. Geo IP is a premium feature.
  • currentpolicy id: tells the banner if the current user has accepted the most recent cookie policy.

How to make use of this info.

There are several things you can do with this info:

  • Run scripts based on the consenttype
  • Run scripts based on the consent level

To use the consenttype, you can just request the data from the local storage:

var cmplz_user_data = [];
if (typeof (Storage) !== "undefined" && sessionStorage.cmplz_user_data) {
    cmplz_user_data = JSON.parse(sessionStorage.cmplz_user_data);
    if (cmplz_user_data.consenttype ==='optin'){
        //do something
    }
}

Because this data may not be available the first pageload (it’s loaded asynchronously after the page has loaded, to minimise impact on page loading), you might consider using our jquery hook to handle this. This Complianz jQuery event runs on consent, and also passes the consent level. Here you can do something based on the consent level (‘all’, ‘statistics’, or your custom event), but as mentioned previously, you can also request the local storage here, and do something based on the consenttype.

$(document).on("cmplzEnableScripts", myScriptHandler);
function myScriptHandler(consentLevel) {
    //your code here
    console.log('run enable scripts event ' +consentLevel);
}

Related articles