How to Show the EU User Consent Banner Only to EU Visitors

GDPR
Last updated: July 12, 2023 | by Aleesha Jacob
show cookie consent banner only to EU users

This post was most recently updated on July 12th, 2023

Some publishers already implemented the cookie consent policy compliance for their readers due this September 30. MonetizeMore already cited some sample implementations of this mechanism. Other publishers are wondering if it is possible for them to enhance the mechanism to make the consent banner show only for EU visitors.

The answer is yes and there are methods available depending on the skill level of the publisher. At the moment, they are quite limited and may increase over time.

Note that these are not the only solutions; these are just sample implementations to get your feet wet in what is technically termed as selective geolocation.

Sample 1: IPInfoDB Filter Addition for Silk Tide Cookie Consent Code on WordPress

(No coding required)

As previously shown, Silk Tide has a Cookie Consent code that can be appended directly to WordPress or static HTML sites.

1) Sign-up for a free account at IPBase or IPInfoDB

If you sign up for a free account at IPBase or IPInfoDB, you will be able to get a free API key.

2) Add the API key to Silk Tide

You can add this key to the Silk Tide code so that you can exclude non-EU member country visitors from seeing the cookie consent banner.

3) Paste code on Wordpress Header File

This code will then be pasted on your Wordpress head’s file. (Themes → Editor → Main Index Page or Header)

How to Show the EU User Consent Banner Only to EU Visitors MonitizeMore

4) Check other design options

You can walk yourself through the design preferences and more detailed process through Site Beam’s very handy configuration wizard.

How to Show the EU User Consent Banner Only to EU Visitors MonitizeMore

Sample 2: GeoPlugin Web Service

(Coding Required)

Depending on your manner of implementation, GeoPlugin provides an open-source means of throwing out an array containing precise geolocation information based on an IP address. The plugin’s official site gives out limited samples but points to a specific line of code that can be used for EU Cookie Consent.

How to Show the EU User Consent Banner Only to EU Visitors MonitizeMore

1) Incorporating a Geo-filter

A publisher with some web development chops can insert a conditional and embed the script to see if the site visitor hails from any of the 27 EU member countries.

A skilled web developer can customize the website’s code to incorporate a filter. Bear in mind that it’s best to find something that can be easily transferred during a website upgrade, owns an implementation procedure well-suited to your needs and skill level and complements your site’s layout well.

Should you be banning visitors from specific countries?

Interestingly, this new policy revives an old discussion sparked online about the advantages and disadvantages of banning a country from visiting your website. From a monetization perspective, if a publisher’s major traffic source comes from the EU continent, then obviously this isn’t the right solution.

Conclusion

Are you compliant with the latest EU data privacy initiatives? Sing up with MonetizeMore and we can help you set up our CMP and ensure your website is gathering user consent properly.


Related Reads:


Related Reading Materials for the Nerds:

  • freegeoip.net
  • github.com/fiorix/freegeoip
  • geoplugin.com
  • geoplugin.com/webservices/extras#eu_cookie_law
  • diveintohtml5.info/geolocation.html
  • github.com/estebanav/javascript-mobile-desktop-geolocation
  • searchengineland.com/should-you-ban-a-country-from-visiting-your-website-71667

Recommended Reading

how-to-generate-tags-for-multiple-ad-units
Blog
November 22, 2024

How to generate tags for multiple ad units?

Read More
A target with a bullseye.
AdSense Ad Optimization
November 20, 2024

How to Find Your Target Audience to Increase Your AdSense Revenue

Read More
Ad Optimization
November 18, 2024

Top 5 Ad Viewability Strategies that will Boost Revenue

Read More

Trusted by 1,500+ publishers worldwide

10X your ad revenue with our award-winning solutions.

Let's Talk

Close

Ready to 10X your ad revenue with the #1 ad management partner?

Start Now