How to display the cookie notice bar to EU visitors only

This article depends on the following two plugins. The CCA plugin works in conjunction with the Cookie Notice plugin.

https://wordpress.org/plugins/cookie-notice/

https://wordpress.org/plugins/category-country-aware/

The following site includes useful information about the Cookie law.

https://www.cookielaw.org/faq/


So do I have to comply with the Cooke Law?

The Cooke Law applies across EU, and affects all businesses who’s website serves customers within any EU country. I understand that the law is implement differently in some countries, however all business in the EU must comply with the regulations. So if most of your audience is outside the EU you can exclude them from the cookie notice. See notes below.

To display the Cookie Notice bar to EU visitors only:

Install the  CCA Plugin and the  Cookie Notice Plugin

Go to  Dashboard->Settings->Cookie Notice to display the bar with your choice of text and options.

Go to Dashboard->Settings->Category Country Aware->Countries scroll down, enable the Cookie Notice check box and save settings.
The CCA plugin will now identify the visitors location and via a hook tell Cookie Notice whether or not to display the bar.
To test if its working –  see this post.
Thanks to those who posted the answers in this  WordPress forum.

But wait, I use caching on my site, will this solution still work?

No. Whilst the cookie notice bar will work just fine as it relies on client JS to display the notice. The GEO IP lookup is handled via PHP and as such the cached page will be based on the the last visitor’s GEO details when the static page was created. So wont perform a unique GEO lookup for each new visitor. Instead you’ll need to implement an Ajax solution.

Was this article helpful?

Related Articles