Share consents across devices

Introduction

The Didomi CMP supports syncing to allow consent sharing across devices and environments. Consent can be shared between all environments that have syncing enabled in the same organization: multiple websites, multiple apps (same or multiple devices), multiple websites and apps together, etc.

When syncing is enabled and an organization user ID is available, the Didomi CMP will load the previously stored user choices from the Consents API and will apply them locally.

Syncing is currently in beta. Please reach out to our Support team ([email protected]) to enable the feature for your account.

Configuration

Setting user organization ID

For the sync process to work properly, an User Organization Id property needs to be set before the Didomi initialization:

Java
Kotlin
Swift
Objective-C
Dart
Java
Didomi.getInstance().setUser("organization-user-id");
Kotlin
Didomi.getInstance().setUser("organization-user-id")
Swift
Didomi.shared.setUser(id: "organization-user-id")
Objective-C
Didomi *didomi = [Didomi shared];
[didomi setUserWithId:@"organization-user-id"];
Dart
await DidomiSdk.setUser("organization-user-id");

This value represents the unique identifier with which the organization identifies the user for which it wants to sync the consents. This can be an email address, a user ID, etc. We recommend hashing the value to not communicate plain user IDs to Didomi.

Enabling sync

The sync process can be enabled with async.enabled configuration option in the Didomi configuration:

{
"app": {
...
},
"sync": {
"enabled": true
}
}

Behavior

Sync timeout

The maximum time allowed for the syncing process to be completed can be specified with a sync.timeout configuration option in the Didomi configuration:

{
"app": {
...
},
"sync": {
"enabled": true,
"timeout": 2000
}
}

The sync.timeout configuration option accepts an integer which represents the maximum time allowed (in milliseconds) for the syncing process to be completed.

If the syncing process takes more time to be completed than it is specified in sync.timeout configuration option, the initialization continues as if there was no data to sync.

Delaying notice showing

The Didomi CMP enables delaying notice showing while the sync is in progress. This ensures that the user never sees the consent notice if sync is possible.

The sync.delayNotice configuration option can be used for delaying the notice showing until the sync is complete:

{
"app": {
...
},
"sync": {
"enabled": true,
"delayNotice": true
}
}

Sync frequency

A fixed syncing frequency can be specified by using a sync.frequency configuration option in the Didomi configuration:

{
"app": {
...
},
"sync": {
"enabled": true,
"frequency": 86400
}
}

When syncing is done, the Didomi CMP stores the date of the latest sync and ensures that sync is not triggered again until the sync frequency is reached.

The sync.frequency configuration option accepts an integer that represents the time interval (in seconds) after which syncing is triggered again.

By default, sync.frequency configuration option is set to 1 day (86400 seconds).

Setting the sync.frequency configuration option to 0 makes the syncing run on on every page load or app launch.