An easy to customize feature to make your CMS Made Simple™ website comply with the EU Cookie Law. In this tutorial I will show you how easy it is to add a cookie consent bar to your CMSMS™ site. A visitor can accept or decline browser cookies. Depending on the visitors choice the, in example advertisement or social media code can be added to the site or not...
I will describe TWO methods:
2 - give the user a real choice which he can decline, so you can't set cookies at your website.
Note: Change this code to your domain name, without http, www, etc. ---^
Note: Change this code to your domain name, without http, www, etc. twice ---^
Smarty can read the browsers DNT setting like this:
You could use this setting in combination with the logic above, like if a person doesn't want to be tracked don't give him the cookie consent question...
When you have analytics software at your website, you don't need to ask permission to set cookies when you don't store personal information.
You can do this by anonymizing the visitors' IP addresses, like 192.168.xxx.xxx or 192.168.100.xxx.
Do you use Piwik you can go to Settings >> Privacy Settings and choose the recommended settings.
Using Google Analytics you can do similar by adding the following line to the GA code:
or depending on your Google Analytics version
At your website you need to create a page with information about the cookies you use at your website. Link this page in the footer of your website.
For more information about the cookie law requirements visit this website Aboutcookies.org
Also visit the website of your government and other related websites giving information of the Cookie Law in your own language.
The EU Cookie Law is very complex and not all countries use it the same way.
I can't guarantee the methods described and the other information you will find here at this page are adequate for your country!
Be sure the jQuery code doesn't conflict with the present code, like double jQuery library calls...
Does anyone know how or if this works on
I've tried, but it seems to be messed up.
I tested both methods in a to 188.8.131.52 upgraded website.
Both work without any problem... You should have something not correct in your template or the way you implemented the tutorial
I just figured out that the problem seems to be that the overlay keeps reopening if I click "Continue". If I reload the page in the browser, though, the overlay disappears.
Since CMSMS 2.0.1
always is true, even if the cookie is set.
Why could that be?
It's definitely a jQuery problem. In the tutorial above I included the call to the jQuery library to get it working. Do you have this call already present in your website, you don't need to add it twice.
Also the sequence of the jQuery calls might be something to look at...
Hope this helps.
Thanks for a simple solution for something we are forced to....
I placed the code on my site and it works for IE, however FF doesn't respond to the "continue" button. Does this sound familiar?
Thanks to Calguy for the browsers Do Not Track addition.