Comply with the EU Cookie Law with Cookie Consent

Posted on November 8, 2016 at 2:06 pm

Cookie Consent is a free and tiny JavaScript plugin for alerting users about the use of cookies on your website. It is designed to help you comply with the EU Cookie Law. The plugin is created by Insites, a registered trademark of Silktide Ltd.

Useful links for Cookie Consent:

More Information About Cookie Consent
Download Cookie Consent (Configuration Wizard)
Cookie Consent Repository on Github
Free Cookie Consent CDN offered by CDNJs.com

Here is a quick example to implement it:

Add this code inside the head tag:

<!-- CookieConsent - START -->
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.1/cookieconsent.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.1/cookieconsent.min.js"></script>
<!-- CookieConsent - END -->

Add this code before the /body tag:

<!-- CookieConsent - START -->
<script>window.cookieconsent.initialise({"palette":{"popup":{"background":"#000"},"button":{"background":"#f1d600"}},"content":{"message":"We use cookies to personalise content, we use also Google Analytics and Google AdSense.","dismiss":"Got it!","link":"Learn more.","href":"http://www.yourwebsite.com/privacy-policy/"}});</script>
<!-- CookieConsent - END -->

* Change the needed text, like the privacy policy URL.

That’s all!

Stay Updated

Other Posts

Updated Posts