As you may already know, cookies can perform a number of useful tasks such as recording your visitor IP address, logging personal settings or track user behaviours from page to page. Since the inception of the 2002 ePrivacy Directive, also known as ‘The Cookie Law’, some webmasters placed simple banners or popups stating that cookies are sent with a simple consent button for users to click. Fast-forward to 25th May 2018 with the birth of the General Data Protection Regulation (GDPR) and updated ePrivacy Directive (ePR), the quick and dirty methods of sending cookies without warning site visitors are no longer acceptable.
The team at CJT have eased the process of adding a cookie consent script on your website. And not only made it easy, but also made it easy to customise to your website theme and colours. Thanks to the team at InSights and a number of other developers (see below in the Credits), you are able to add a cookie consent script with absolute ease – check out what you can do below:
- customise the banner colours
- adjust the banner position
- add your own cookie consent message
- change the button text
- change the cookie consent theme
There are even a number of advanced features to help with full GDPR compliance, including:
- adding GeoLocate to only show the cookie consent banner to visitors residing in countries of the European Union
- create callback hooks for showing/accepting/revoking the cookie consent banner
- support for different types of compliance, giving you the flexibility to obey even the strictest cookie laws
CJT has made it super simple to import into your website with just a few clicks. It will automatically add them to three code blocks, where you can customise the settings, modify the CSS, and change the main Consent My Cookie script itself. We have provided instructions below so follow carefully.
- Click and download the consent-my-cookie.zip file above
- If your browser or operating system automatically unzips the file, please compress it back into a .zip file
- Click the Import tab
- Upload the consent-my-cookie.zip file
- For the code block called Consent My Cookie, go to the Assignment Panel and select the Aux tab. Click the checkbox called Entire Website and then click Save
- Repeat the steps above for the Consent My Cookie – CSS code block (i.e. select the Aux tab and click Entire Website). Click Save
- Repeat the steps above for the Consent My Cookie – JS code block (i.e. select the Aux tab and click Entire Website). Again click Save
- Refresh your website and then view the result
- After you have clicked the button to consent to cookies being sent, if you want to test the script again, then you will need to delete the cookie in your browser cache. This can be done in the browsers developer tools (e.g. Inspector).
- We have added customisation instructions as code comments, which is quite easy to follow. If you want to check the advanced features and examples such as the callback hooks for enabling or disabling cookies, or even view the script API, then click: Consent My Cookie Documentation and API.
Cookie Consent v3
Oliver Emberton (@oliveremberton) – a couple of lines of CSS, maybe
Cookie Consent v2
David Ball (@drball) – CSS / themes