Simple E.U. Cookie Policy Widget code

On 8 January, 2013 by Carol

cookie policy scripts Simple E.U. Cookie Policy Widget codeIf you live in Europe and you have to abide the E.U. cookie law, then you need a code or a plugin to give your visitors the option to accept or reject cookies or you’re up for a fine.

I already wrote an article on this – EU Cookie law plugins and codes - but after working on my website’s speed and adding some plugins to deffer JavaScript – which  i will explain in a bit – i realized that my code kept disappearing or getting blocked, so i decided to look for something simpler instead: Simple E.U. Cookie Policy Widget code.
And then I found a great script offered free at HeartInternet.co.uk.
Thank you so much, guys!

Minifying?

Minifying is the process of removing all unnecessary characters from source code, without changing its functionality. These unnecessary characters usually include white space characters, new line characters, comments, and sometimes block delimiters, which are used to add readability to the code but are not required for it to execute.….[Wikipedia]

Using minifying plugins on WordPress has its advantages and disadvantages.
Advantage: it makes your website load faster by combining and compressing.js and .css files.
Disadvantages: it can block some script such as pop-ups or bars.

In my case, my WP-Minify plugin helped a lot, but it blocked the plugin i used to allow the visitor to accept or reject cookies.
The added files to not be processed didn’t work but it does work with this scrip below because by adding the two .js links to the “JavaScript files to exclude from minify” rule nothing gets blocked.

j14fFF7vN2tJ6 Simple E.U. Cookie Policy Widget code

This script is dead easy to use. Just copy and paste it into the footer of your wordpress theme, just before </body> and change the last link in the code with your own Policy link and click save. That’s all. No more plugins and loads on the server.

If you use WP-Minify, just add the two .js links to the exclusion rule like in the shot above and you are set.

Dark version

<link rel=”stylesheet” type=”text/css” href=”http://www.heartinternet.co.uk/eu-cookie/main.css”/>
<script type=”text/javascript” src=”http://www.heartinternet.co.uk/eu-cookie/support-opt-in.js”></script>
<script type=”text/javascript” src=”http://www.heartinternet.co.uk/eu-cookie/require-opt-in.js” read_more=”http://www.your-site.com/privacy-policy”></script>

Light version

<link rel=”stylesheet” type=”text/css” href=”http://www.heartinternet.co.uk/eu-cookie/main.css”/>
<link rel=”stylesheet” type=”text/css” href=”http://www.heartinternet.co.uk/eu-cookie/white.css”/>
<script type=”text/javascript” src=”http://www.heartinternet.co.uk/eu-cookie/support-opt-in.js”></script>
<script type=”text/javascript” src=”http://www.heartinternet.co.uk/eu-cookie/require-opt-in.js” read_more=”http://www.your-site.com/privacy-policy”></script>

The rest of the settings can be found on the HeartInternet.co.uk.

 

%d bloggers like this: