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


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.

pgu cta

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 IPInfoDB

There is a recent development. If you sign up for a free account at 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)

Paste code on Wordpress Header File

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.

Check other design options

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.

GeoPlugin Web Service

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.


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:


Recommended Reading


Optimize Page RPMs with our PubGuru Page Report

Read More
Ad Optimization

AdOps Recession 2022: A Wild Ride Ahead

Read More

Video Monetization Strategies: Which One is best for You?

Read More

Enjoying this post? Let's put things to action

Get started