Skip to content

Cross Device Consent Sharing (Session Restore)

Premium Feature

Cross-Device Consent Sharing is a Premium Feature that is only enabled on request. Please reach out to your Customer Success Manager for more information.

Overview

This feature is a specialized tool designed for a specific use case: retrieving user consents that were previously granted on a different device. This feature is ideal for scenarios where users switch between devices, such as moving from a web interface to a smartphone.

Use Cases

  • User Switching Devices: A user grants consent on a web application and later accesses the mobile app. Using 'Restore User Session', the consents are carried over, eliminating the need for re-consent on the mobile app.
  • Login Process: Integrate the 'Restore User Session' feature during the user login routine to seamlessly transition consents across different sessions or platforms.

Implementation

The user session can be restored by providing the Settings-ID (key that defines your configuration) and the Controller-ID (key which identifies the consent details previously stored for that user).

1. Add the JavaScript tag

Add the Usercentrics script to the <head> section of your website, loading it from the standard CDN URL:

CDN URL
https://web.cmp.usercentrics.eu/ui/loader.js

2. Retrieve the Controller ID

The Controller ID is generated per user session and can be found in the CMP's second layer (More Information / Details), where it is displayed together with a copy button. Retrieve it from the device/session where consent was originally granted, for example by reading it from UC_UI.getControllerId() (or the corresponding SDK/API call) once the CMP has initialized.

3. Configure the script tag

Add the retrieved Controller ID, together with your Settings-ID, as attributes on the CMP script tag:

Session Restore script tag
<script
    id="usercentrics-cmp"
    data-settings-id="YOUR_SETTINGS_ID"
    data-controller-id="YOUR_CONTROLLER_ID"
    src="https://web.cmp.usercentrics.eu/ui/loader.js"
>
</script>

4. Initialize the CMP

Load the page with the script tag in place. On initialization, the CMP will use the Controller-ID and Settings-ID to fetch and restore the consent decisions previously recorded for that user, so they are not asked to consent again.

Security Note: Controller ID visibility

The Controller ID is not a secret. It is sent as a plain query parameter when the CMP fetches the stored consent (visible in browser network requests and page source), and it is also displayed directly to end users in the CMP's second layer. Treat it as a public identifier rather than a credential: it identifies a consent record, but on its own it cannot be used to access other personal data or systems. Do not rely on it for authentication or authorization, and avoid combining it with other sensitive identifiers in a way that could make a user re-identifiable.