Skip to content

Configuring Usercentrics

Once you have installed the Usercentrics SDK, you will need an account to configure your consent banner.

Depending on your configuration you will need a SettingsID or a RulesetID to initialize the Usercentrics SDK

SettingsID

RulsetID

Device Options

In addition to the SettingsID, you may also configure the following options to control different behaviours at a device-level:

Property Type Notes
settingsID String A Usercentrics generated ID, used to identify a unique CMP configuration.
defaultLanguage String Selected based on our language selection hierarchy. This property defines the language used to render the banner. e.g. "en", "de", "fr".
version String To freeze the configuration version shown to your users, you may pass a specific version here. You may find an overview of all versions in your Configuration Dashboard under Configuration > History > Settings History > Version (Column) or Implementation > Script Tag > Version History. e.g. "3.0.4". Passing "latest" (default) will fetch the latest version of your CMP configuration. Passing "preview" will fetch the latest draft of your CMP configuration.
timeoutMillis Int Timeout for network requests in milliseconds. We do NOT recommend overwriting this field unless absolutely necessary or for debugging reasons, as well as using any values under 5,000 ms. Default is 10,000 ms (10s).
loggerLevel Enum Provides a set of logs for operations being executed in the SDK. debug: includes every other level, warning: non-problematic operations, error: relevant logs to any blocking problems and none (default).
rulesetId String A Usercentircs generated ID, used to identify a bundle of CMP configurations to be used depending on the user's location.
consentMediation Bool Enable Consent Mediation, an automated way to pass consent to 3rd party frameworks.

Language Selection Hierarchy

The SDK uses the following hierarchy, when deciding which language to load on init:

LanguageHierarchy

On first init, Default Language1 2 will have first priority, then Device language1 2 and finally a hard default to the first language available in your configuration. Once a language has been selected, it will be stored. Any following SDK initializations will use the Stored Language 3.


  1. To be supported, a language needs to be added and set as visible in the Configuration Dashboard, under Configuration > Setup > Language Settings. 

  2. This value will only be checked during the first SDK initialized. Afterwards, the stored languages will be used. 

  3. If a user explicitly selects a new language in the Usercentrics UI, or the language is changed programmatically after init, the stored languages will be updated and take priority in the future.