It may sound funny, but to handle the blocking of
- cmplz_marketing: 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
- cmplz_preferences: user has consented to the preferences level
Apart from the cookies Complianz Privacy Suite also uses the local storage in a user’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):
- 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
- 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
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:
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.