This articles explains how Usercentrics CMP determines and assigns the language the consent banner will be displayed in.
In particular the concepts of Strict and Automatic language assignment are explained.
Overview
Please note
For a language to be assigned it must be added in your configuration in the Admin Interface.
Strict assignment
Use Case
This mode is useful when operating region-/language-specific websites that should always be shown in a particular language.
Implementation
You can initialize the Usercentrics script directly using your language of choice by adding the parameter data-language="{{language_code}}"
, where you replace “{{language_code}}” with the code of the language that you would like to use1.
An example for customers using CMP version 3:
<script
id="usercentrics-cmp"
data-settings-id="XXXXXX"
src="https://web.cmp.usercentrics.eu/ui/loader.js"
data-language="de"
async
></script>
1 Please use the language code in ISO 639-1 format: List of ISO 639 language codes.
Please note
The banner will always appear in this explicitly specified language.
Automatic assignment
Use Case
The automatic mode is useful when operating a single website that receives international traffic and that is available in several different languages. It allows website operators to dynamically determine which language the CMP should be shown in.
Also, this mode respects the user’s choice if the user changed the language via the language switch in the CMP UI, as the language is stored in the local storage and the CMP will be initialized with the language from the user’s local storage on recurring website visits.
Implementation
Implement your Usercentrics script without defining a language and allow Usercentrics CMP to automatically determine in which language your consent banner should be displayed.
Usercentrics CMP follows a specific hierarchy to determine which language is assigned to the consent banner.
The hierarchy is as follows:
- CDCS Local Storage
The user’s language preference is transferred from another website that is connected to the current website via Usercentrics' Cross-Domain-Consent-Sharing iframe. - Website Local Storage
The user’s language preference is already stored in the local storage of the current website because he/she has visited the page before. - lang-attribute on <html> tag
E.g.<html lang=”language_code”>
is integrated on the website. - The browser's language preference setting.
- "Default Visible Language" as set up in the Admin interface, if the browser's preferred language(s) are not part of the preselected language set.
The preferred language for the consent banner will be written into the local storage of the website. Any Usercentrics element will be displayed in that language during future visits.
Summary
Usercentrics offers two main “modes” to set the language of the privacy banner. The strict mode allows the CMP to be shown only in one specific language. Therefore the language specification should be set in the CMP script. In the Automatic mode you let Usercentrics automatically determine in which language your CMP should be displayed based on certain hierarchy. This later mode is relevant for websites that receives international traffic.
Comments
0 comments
Please sign in to leave a comment.