Many websites will have received an email informing them of Google’s Ads policy requiring sites using Adsense to obtain cookie consent from European “End Users” (visitors) to “comply” with EU Law. i.e. add a cookie bar to your pages.
On visiting a site with an “allow cookies” notice, I don’t feel empowered just distracted. However; it is possible display cookie notices to EU visitors ONLY, sparing your non-EU visitors this annoyance (and partially functioning cookieless pages).
New GDPR: This article was originally written in 2015; the EU has now introduced stricter (GDPR) requirements (see final paragraph of this post). Dfactory has confirmed Cookie Notice will be 100% compliant with GDPR by the deadline of 25 May 18.
Make your WordPress Site display a Cookie Law bar only to visitors located in the EU
If you are using a caching plugin read this first
The CCA plugin identifies your visitor’s location, and tells Cookie Notice when to display the EU Cookie Law bar. Cookie Notice displays your customized bar.
2. Configure Cookie Notice to display the bar with your choice of text and options in an appropriate style and position for your site.
Dashboard->Settings->Cookie Notice customise and save settings.
3. Set the CCA plugin to control Cookie Notice output.
Dashboard->Settings->Category Country Aware
(On first use of CCA plugin only: go to the “General” tab and check the “Intialize GeoIP” box and Save Settings. then:)
Open the “Countries” tab, scroll down, enable Cookie Notice check box and save settings. If you wish you can also edit the list of “EU country codes”.
*** Job Done***
4. A quick test to ensure its working:
Just add or remove the country code for your location from the list of countries and save settings, and go to one of your posts. If the list includes your country code the bar will be displayed, otherwise it won’t. Don’t forget to change the list of counties back to its original setting.
Other “EU” functionality provided by the CCA plugin (advanced users)
The CCA plugin also provides 2 short codes that can be used in posts and shortcode enabled widgets:
[cca_not_EU]some text/JS/other shortcodes included if non-EU visitor[/cca_not_EU]
You are [cca_not_EU]NOT [/cca_not_EU]from the EU.
Live example: You are NOT from the EU.
EU visitor detection function for use in your own PHP code (or by other plugins):
cca_is_EU() returns TRUE if visitor is from the EU; or false otherwise.
N.B. Your list of “EU” countries (see image above) is used to determine whether or not the visitor is “from the EU”.
To enable shortcodes in CCA widgets you will need to add the CCA extension.
If you are using a caching plugin
Using caching plugins other than Comet Cache and WP Super Cache?
Then you shouldn’t use this solution. Caching plugins do not usually work with server geo-location; they take a “snapshot” (cache) of a page when it is first visited and all subsequent visitors see the same snapshot. If the first visitor was from Germany then the snapshot will include the cookie bar and your visitor from US will be served this snapshot and also see the cookie bar.
Using Comet Cache or WP Super Cache:
If you are using Comet Cache you can install and configure this Country Caching extension to make caching country (and EU) aware. Likewise; for WP Super Cache you can install this WPSC extension.
More about the CCA plugin
I’m the author. Most of the sidebar content on this page is provided by CCA widgets, what is displayed depends upon the category of the page and where you are from (if you view my posts on Chinese Phablets you will see different sidebar content).
You can also have responsive ads within posts that only appear on small devices. and much much more. More on its capabilities in this post.
As from 25 May 2018 compliance with new EU GDPR regulations will be required; including a requirement to obtain a positive user consent for the serving of cookies.
The CCA plugin sets Cookie Notice’s “cn_cookie_notice_output” filter to prevent display of the cookie bar and blocking of cookies. It works with the current (and previous) releases of Cookie Notice. However, it is possible that the logic used in the next (“100% GDPR compliant”) release of CN will be so radically changed that the above filter will no longer do the job. I assume that if this is the case Cookie Notice will provide other filters that can be used to do the job and the CCA plugin will be modified to use them instead.
GDPR regulations are complex and you will see conflicting interpretations on how to comply. It’s no coincidence that WordPress has just announced that plugins in its directory are now forbidden from claiming compliance with any law.
I cannot afford a lawyer and am personally working on the assumption that (for cookies) a combination of the following Cookie Notice settings will be sufficient:
- Button text set to “allow Cookies”
- More info link enabled with link to your GDPR compliant page about cookies.
- Refuse button enabled with text “Deny cookies”
(Cookie Notice says it will be 100% GDPR compliant. So I assume that by 25 May 18 it will provide visitors who opted to accept cookies the option to change their mind and subsequently reject them.)
You should read more about GDPR, and make your own call on what is required. Dfactory’s Cookie Notice support forum might be able to offer advice?