LW IT Solutions logo LW IT Solutions logo LW IT Solutions
« Blog Overview /Data Privacy/Tutorials / Showing Different Cookie Banners by Country: Setting...
Read this article in other languages:

Showing Different Cookie Banners by Country: Setting Up Regional Rules in Usercentrics

Showing Different Cookie Banners by Country: Setting Up Regional Rules in UsercentricsShowing Different Cookie Banners by Country: Setting Up Regional Rules in Usercentrics

Management Summary

Usercentrics manages website consent notices and the choices controlling connected services. Its location rules can apply different settings according to the country estimated from an internet address. This is useful for sites serving several regions, but the detected country does not itself determine which law applies. The article explains why regional choices need to cover actual service behaviour as well as the banner: hiding the notice can also mean treating services as accepted.

Contents
  1. 1. Configurations and responsibilities
  2. 2. A global default and regional rules
  3. 3. The matching implementation script
  4. 4. Checks of selection and actual data flows
  5. Questions and answers
  6. Sources

Geolocation rules select a Usercentrics configuration using an IP-based location estimate. Settings IDs identify individual configurations; a Ruleset ID identifies their regional mapping. For example, a rule can select configuration A for an IP address assigned to Germany and the global configuration for an unmatched country. This technical selection does not determine which privacy rules apply to the actual processing.

A blanket profile of “outside the EU/EEA means no consent” is unsuitable. Other regions also impose privacy obligations, and GDPR applicability does not depend solely on the detected IP country. The starting point is a documented decision for each processing activity and region, rather than a desired banner rate.

1. Configurations and responsibilities

Different regional behaviour requires the relevant configurations with their own Settings IDs. Uniform worldwide behaviour does not necessarily require two profiles. A concise mapping records the region, Settings ID, services, consent requirements and responsible approval.

Services that require consent remain blocked before consent is given. Strictly necessary functions need separate assessment. The consent management platform (CMP) manages the banner and stored choices. It must be connected to the actual scripts and tags, the code that loads services or sends measurement data; listing a service in the banner does not automatically block every existing integration.

Workflow covering configurations, ruleset, matching loader and tests of consent and data flows.
The ruleset selects the configuration. Consent requirements and actual tag blocking still need separate checks.

2. A global default and regional rules

A ruleset is created under Geolocation Rulesets. Its Global Configuration defines the default; regional rules connect selected areas to other Settings IDs. Included configurations must not impose conflicting additional geographic restrictions.

The country selection needs explicit review: the EU bundle, for example, includes neither the United Kingdom nor Switzerland. The label “Rest of World” alone cannot establish a common legal treatment for multiple jurisdictions.

“Do not display CMP layer” is not merely a visual option. The vendor states that the CMP continues running in the background with all services consented by default. That effect belongs in approval and testing. An automatic product default is not consent actually given by a visitor.

3. The matching implementation script

The Ruleset ID controls regional selection. The loader is the script that loads the CMP. The documented newer loader uses data-ruleset-id. Leaving a fixed data-settings-id in place instead loads the individual configuration.

<script id="usercentrics-cmp"
  data-ruleset-id="RULESET_ID_PLACEHOLDER"
  src="https://web.cmp.usercentrics.eu/ui/loader.js"></script>

The script belongs in the document head before services requiring consent. The example applies to the specified loader and contains a placeholder ID. The older Browser UI documentation for app.usercentrics.eu/browser-ui/latest/loader.js uses ruleset-id instead. Loader and attribute must match. The implementation instructions for the CMP version in use take precedence. A second parallel CMP installation should be avoided.

4. Checks of selection and actual data flows

A VPN routes the connection through another server, so the website sees that server’s IP address. A VPN or an external test location can therefore exercise IP-based selection. A VPN is not the only testing option: the Browser SDK also documents userCountryData for simulation in test integrations. Simulation does not replace testing production IP detection.

  • Fresh visit: The test starts with a new browser profile or with all site data cleared. Clearing only the HTTP cache does not remove stored consent.
  • Region: The test records expected and loaded configurations for each intended area and for an area without a matching rule.
  • Decision: Checks cover network requests, cookies and storage access before selection, after rejection, after approval and after subsequent withdrawal.
  • Failure: Missing location data and loading failures receive separate tests. Consent-dependent tags must not start independently while consent remains unresolved.
  • Return visit: The test covers a subsequent visit with a stored choice and a change of test region.

The visible banner alone proves neither the correct Settings ID nor effective blocking. The loaded CMP configuration in the network log can be compared with the mapping. Account-specific menus and available features may differ from the documentation version described here.

Questions and answers

How can multiple profiles remain consistent?

A common service inventory and documented regional differences form the reference. Every change to services, tags or legal bases triggers a comparison of all affected configurations. Periodic checks supplement that process; quarterly comparison alone would leave new errors in place until the next review.

What happens without a matching regional rule?

The ruleset’s global configuration is the documented fallback. This differs from embedding a fixed Settings ID without a ruleset. A failed CMP request is a separate failure case and does not prove that the global default loaded successfully. The integration needs tested initial blocking of consent-dependent tags.

Does an unexpected banner prove a geolocation error?

No. Possible causes include IP classification, rules, the embedded ID, configuration version and stored decisions. A CDN country code is another observation, not proof of physical location. Diagnosis therefore compares detected region, loaded configuration and actual tag behaviour during the same test.

Lukas Wojcik

Lukas Wojcik

Systems architect and technology enthusiast specializing in scalable tracking solutions, GMP Stack (GA4 & GTM), and robust backend architectures. Advocate for clean code and privacy-first design.

Get in touch

A question or an idea for a web project? Tell me a little about it. This form uses reCAPTCHA and formconfirmed to protect against spam.

Write a comment

Observations from other implementations, objections and questions are welcome here.

The email address is not published. Required fields are marked with an asterisk.

LUKASWOJCIK.COM · NEWSLETTER

Fresh ideas in your inbox

New articles, practical tools and updates from the projects.

Choose topics (optional)
No selection: all topics.

Subscription starts after confirmation by email. · Privacy

Privacy · Newsletter

Email address, language, selected topics and subscription/confirmation dates are stored to deliver the newsletter. Double opt-in is required. Every issue includes an immediate unsubscribe link. Formconfirmed checks the signup for spam. No email open or click tracking.

Read the full privacy policy ↗