Basic configuration 

After the extension is installed first you have to load the typoscript into your static template.

Basic configuration 

After the typoscript is loaded you have to override the constants of this extension and set them to load the usercentrics Library on you page.

Best Practice 

Create a Constants.typoscript file in your provider extension to override the default constants. You can create it in subfolder like this: my_extension/Configuration/TypoScript/Extensions/LiaUsercentrics/Constants.typoscript. Make sure that this file is also loaded in your constants.typoscript file. To load this file add an import in it. @import 'EXT:site_package/Configuration/TypoScript/Extensions/LiaUsercentrics/Constants.typoscript'

Now place this code in it and set the constants to your need.

EXT:site_package/Configuration/TypoScript/Extensions/LiaUsercentrics/Constants.typoscript
plugin.tx_liausercentrics {
  srcUrl = https://web.cmp.usercentrics.eu/ui/loader.js
  settingsId =
  ucQueryParameter =
  settings {
    activate = 0
    tcfEnabled = 0
    useSmartDataProtector = 0
    footerLink = 0
    excludedPages =
    whitelistedSDPServices =
    customOverlayIntegration =
  }
}
Copied!

To load Usercentrics, enter your Usercentrics ID in settingsId and set the constant activate to 1. If you want to use the Smart Data Protector, set the constant the constant useSmartDataProtector to 1.

Language 

The current language is passed to Usercentrics automatically by getting the language code from the current locale:

EXT:site_package/Configuration/TypoScript/Extensions/LiaUsercentrics/Setup.typoscript
plugin.tx_liausercentrics {
  ...
  language = TEXT
  language.data = siteLanguage:locale:languageCode
  ...
}
Copied!

The language variable accepts plain strings and content objects like TEXT.

TCF enabled 

Set the constant tcfEnabled to 1 to add the data-tcf-enabled attribute to the Usercentrics script tag. This activates the IAB Transparency & Consent Framework (TCF) mode in Usercentrics.

EXT:site_package/Configuration/TypoScript/Extensions/LiaUsercentrics/Constants.typoscript
plugin.tx_liausercentrics {
  settings {
    tcfEnabled = 1
  }
}
Copied!

This renders the following script tag in the page header:

<script id="usercentrics-cmp" src="..." data-settings-id="..." data-language="..." data-tcf-enabled></script>
Copied!