Create a EU Cookie Consent Plugin for WordPress

A cookie is a small piece of information that is stored inside website and it asks visitor’s web browser on computer or mobile devices when website runs on it. Most of times, these cookies stays with web browser for some time so that in the next visit website loads quickly and apart from it various other information management such as behavioral patterns of users, traffic analysis, social media usages, analysis patterns are collected from users to understand what are their basic needs and demands when they visit such digital products. Most web browsers support installation of cookies mostly by default and it is the prerogative of users to accept it or decline it and they can set the web browser in this regard for this.

Websites are stored in outside main servers and they are required to send and receive web page from there. In the process of sending and receiving information most times, the web server fixes one cookie on the web browser and, then it sees when the user goes to another page it sees the patterns and usages patterns and send those information to server. There are various types of cookies. Session cookies are for user’s session and most times got erased when the user stops browsing of web during that particular session. Persistent cookies remain with the computer for longer duration and stays there and send information about user’s habit and the web browsing activities. Third party cookies are the source and installation of information on user’s web server of a third party add on. Plugins and other information.

First party cookies send the information to server when the user visitor the same page of the domain. This means it intended to identify users, remember customer’s preferences and help us administrator to complete these tasks in a seamless manner about knowing out visitor’s usages patterns.
EU legislation of cookies:

According to cookiechoices.org ,

“European laws require that digital publishers give visitors to their sites and apps information about their use of cookies and other forms of local storage. In many cases, these laws also require that consent be obtained.” The website cookiechoices.org is produced by Google. Websites should provide easy to implement tools to let users notify about it so that if the user wish to browse through website by agreeing to user’s consent then it should be ok.

 

It is a complicated subject and even Google cannot say what you should be using it and most of the individual web producer like myself does not have so much of the resource to go for legal assistance but implementing and providing information to the user is a good idea. Google suggests writing the below information which should be appropriate most for individual web masters like myself. Google suggests writing,

‘We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information you’ve provided to them or they’ve collected from your use of their services. See details’

(Source: )

In the see details link there should be additional link to provide more information such as if you use Google product link such as adsense, analytics then you should provide detail policy requirement of information which you should find in the www.cookiechoices.org It is one way of implementing consent mechanisms and inform users from European Union about cookies and other informations you are using on your website.

How to create Cookie Consent Plugin for WordPress :

From above reading you must have realized that installation of cookie consent plugin or information should be there on website. There are numerous third party plugin for wordpress but that could install one more cookie and other third party links and reduces the download time of website to a considerable extent. Here is the code which you should be installing on self-hosted wordpess website just before ending </head> tag.

It is a good idea to log in to cPanel and then reach for files and then file manager and then wp-content, then themes and then the currently activated theme. Then open header dot php. Before back it up on local computer and then cltr+F and paste </head> to search for this ending head tag and then paste the following plugin code just before it and save the header dot php and open website to see the information about cookie consent out there.

Here is the code

 

<!-- Cookie compliance notice -->



                        <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />

<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>

<script>

window.addEventListener("load", function(){

window.cookieconsent.initialise({

  "palette": {

    "popup": {

      "background": "#000"

    },

    "button": {

      "background": "#f1d600"

    }

  },

  "content": {

    "message": "We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information you’ve provided to them.",

    "dismiss": "OK",

    "link": "See Details",

    "href": "https://mohanmekap.com/mohanmekap-com-privacy-policy/"

  }

})});

</script>

 <!-- Cookie compliance notice -->

 

 

 

 

 

Here changes the privacy policy or cookie policy link with that of yours. The bold links to be changed with that of your website privacy or cookie policy link. To learn about how to write a cookie policy link you can learn from this Google link.

In this small little plugin code, the position of cookie consent banner is at the bottom. The lay out is block with default theme pallet. The learn more link which you can change as per written above. This plugin aims to tell users that we use cookies.

The message inside the cookie to be appeared is ‘We use cookies to personalise content and ads, to provide social media features and to analyze our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information you’ve provided to them.’ This message we got from cookiechoices.org which is website produced by Google. We have implemented the dismiss button text of ‘OK’ as per advice of Google and the policy link text to privacy policy or cookie policy is ‘See Details’.

*A few days ago. I read a post on cookieconsent.insites.com which discussed ‘A free solution to the EU Cookie Law’. I’d never hear of this before, but I was intrigued, so I read on.*

 

Related Post