Skip to content

Optional Steps

Draft Script

To test new changes within the Admin Interface before releasing them to your live environment, you can save any changes to a draft version. To display this draft version, you will need to add a data-draft="true" attribute to the CMP script tag.

    <script
        id="usercentrics-cmp"
        data-settings-id="YOUR_SETTINGS_ID"
        src="https://web.cmp.usercentrics.eu/ui/loader.js"
        data-draft="true"
    </script>

Adding a nonce to the script tag

To add a nonce to your personal script, you can add it like so:

<script
    id="usercentrics-cmp"
    data-settings-id="YOUR_SETTINGS_ID"
    src="https://web.cmp.usercentrics.eu/ui/loader.js"
    nonce="nonce-VALUE"
</script>
<script
    id="usercentrics-cmp"
    data-settings-id="YOUR_SETTINGS_ID"
    src="https://web.cmp.usercentrics.eu/ui/loader.js"
    data-tcf-enabled
    nonce="nonce-VALUE"
</script>

If you're using Usercentrics Cross Domain Consent Sharing (CDCS) your website visitors might still see the CMP again when switching to another subdomain, for example mywebshop.com to checkout.mywebshop.com. Modern browsers are causing this behavior as they block the shared iframe provided by Usercentrics. The following section describes the needed steps to prevent this from happening.

Important

This solution will improve user experience for most browsers, however currently we have some browser related restrictions: CDCS does not work without sharing 3rd-Party local storage information across different browser tabs or if the user enabled special privacy settings within the Browser settings.

  • Safari: CDCS does not work with Safari, since the browser does not share 3rd-Party local storage across different browser tabs. Due to this restriction, the feature can not share the iFrame's local storage across different tabs
  • Firefox: If the option "Delete Cookies" is enabled, the feature does not work, since Firefox clears the local storage for every new tab automatically, which prevents saving consents.
  • Chrome: From Chrome version 115 and going forward, CDCS does not work between different root domains (ex. a.com → b.com) because of restrictions that Google have imposed on third-party storage possibilites. This means, that our current implementation of CDCS now effectively only works between root domains and their subdomains (ex. sub.a.com → a.com → othersub.a.com). Read more about the updates that Google have made to Chrome here.
  • Download the file cross-domain-bridge.html (right click > save as ...)
  • Upload this file to your webserver. It should be reachable from your main domain that is included in all of your subdomains. For example: https://mywebshop.com/cross-domain-bridge.html
  • Before the Usercentrics CMP script tag, set the new location of the Cross Domain Bridge via the window.UC_UI_DOMAINS.crossDomainConsentSharingIFrame property (this should be added into all the domains, including the main domain).

Example

A complete example might look like this

<html>
<head>
<script>
    window.UC_UI_DOMAINS = {
        crossDomainConsentSharingIFrame: 'https://mywebshop.com/cross-domain-bridge.html',
    };
</script>
<script id="usercentrics-cmp" data-settings-id="XXXXXXXX" src="https://web.cmp.usercentrics.eu/ui/loader.js" async></script>
</head>
<body>
</body>
</html>

White labeling URLs

For customers that only allow sources from the same domain on their websites for security reasons, you can now configure from which address all Usercentrics resources (JSON files, JavaScript files etc.) should be loaded.

This should be configured before the UI script from "Add the JavaScript Tag"

In order to configure the domains please define the window variable called ucCmpConfig with the following structure:

window.ucCmpConfig = {
    proxy: {
        api: '',
        consent: '',
        crossDevice: '',
        logger: '',
        cdn: '',
    }
}

Our Endpoints

Important

Your proxy servers should point to the following domains

Regarding Cross Domain Consent Sharing feature you can white label only the domain via app key or provide a full URL to be used for this feature via crossDomainConsentSharingIFrame key

Name Purpose Key Domain
Api Api to communicate between the UI and the SDK / backend api https://v1.api.service.cmp.usercentrics.eu
Consents Get the consents data for Cross Domain feature consent https://consent-api.service.consent.usercentrics.eu
Cross Device Consents Get the consents data for Cross Device feature crossDevice https://consent-rt-ret.service.consent.usercentrics.eu
GraphQL Stores all user decisions on server logger https://graphql.usercentrics.eu
CDN URL used on Cross Domain Consent Sharing Iframe to get data cdn https://web.cmp.usercentrics.eu