Customize the notice
The notice is the first banner or pop-in that gets displayed on your app to ask the user to give consent. It is a short version of the full Preferences pop-in that has all the details on the purposes and vendors that you are collecting consent for.
This section presents the main customization options that are available for the consent notice.

Country and GDPR

If you are an EU-based company then you must collect consent and enforce GDPR for all users no matter where they are located. There is no exception to that rule so you'll want to keep the properties app.gdprAppliesGlobally and app.gdprAppliesWhenUnknown to true.
If you are not an EU company then your only obligation is to enforce GDPR for EU-based users. We offer the following two configuration options for you to define what behavior you want:
    app.gdprAppliesGlobally defines whether GDPR should be applied to all visitors or not. If set to true, all visitors will see consent notices. If set to false, only visitors from the EU will see the consent notices.
    app.gdprAppliesWhenUnknown defines what to do when the user country is unknown. If the SDK is unable to determine the user country (because the device does not have a location, the location permission is not available, or there is no Internet connection), this flag will decide if the user should see a consent notice or not. If set to true, the user will see a consent notice when its country is unknown.
Example:
didomi_config.json
1
{
2
"app": {
3
"gdprAppliesGlobally": true,
4
"gdprAppliesWhenUnknown": true
5
}
6
}
Copied!

Publisher country

You can define your publisher country code by setting app.country property in the configuration file (2 letters, ISO 3166-1 alpha-2). This value will be used when generating the IAB TCF consent, both in the consent string and stored on device with the IABTCF_PublisherCC key.
Example:
didomi_config.json
1
{
2
"app": {
3
"country": "ES"
4
}
5
}
Copied!

Supported languages

Our SDK supports multiple languages out-of-the-box with translations for all our standard messages. See below if your website uses other languages. English is the default language: if a visitor does not use a supported language, the banner and popups will be displayed in English.
You do not need to do anything to use Didomi's languages. However, you can choose to enable only certain languages and set up a different default language. Set the languages.enabled property to your list of supported languages and languages.default property as the default language in case the customer language is not supported:
didomi_config.json
1
{
2
"languages": {
3
"enabled": ['en', 'fr'],
4
"default": 'fr'
5
}
6
}
Copied!
By default, enabled is the list of supported languages by Didomi and default is en. You can support a different language by changing the English texts and setting English as the only enabled language.
We currently support the following languages:
Language
Code
Arabic
ar
Bulgarian
bg
Catalan
ca
Chinese (simplified)
zh-CN
Chinese (traditional)
zh-TW
Croatian
hr
Czech
cs
Danish
da
Dutch
nl
English
en
Finnish
fi
French
fr
German
de
Greek
el
Hungarian
hu
Italian
it
Japanese
ja
Korean
ko
Lithuanian
lt
Malay
ms
Polish
pl
Portuguese
pt
Romanian
ro
Russian
ru
Serbian
sr
Slovak
sk
Slovenian
sl
Spanish
es
Swedish
sv
Thai
th
Turkish
tr
Ukrainian
uk
Vietnamese
vi

Position (Mobile only)

On mobile, the notice can be displayed as a popup or a regular bottom banner.
The notice.position configuration parameter lets you define the position of the notice. The possible values are:
Values
Description
popup
Display the notice as a full-screen popup. Also set your website logo and name to make sure the popup is personalized.
bottom
Display a banner notice at the bottom of the screen
Examples:
Bottom banner
Popup
didomi_config.json
1
{
2
"notice": {
3
"position": "bottom"
4
}
5
}
Copied!
didomi_config.json
1
{
2
"notice": {
3
"position": "popup"
4
}
5
}
Copied!

Disagree & Close

You can enable the "Disagree & Close" option from the notice by setting the type property to optin as shown below:
1
didomi_config.json
2
3
{
4
"notice": {
5
"type": "optin"
6
}
7
}
Copied!
By default a secondary button containing the "Disagree & Close" text will be shown and the "Learn More" button will be shown as a link.
Expected result:
Disagree & Close button when type is set to optin (Mobile)
Disagree & Close button when type is set to optin (TV)

Disagree & Close as primary (Mobile only)

You can optionally show the "Disagree & Close" button as a primary button by setting the denyAsPrimary to true as shown below:
1
didomi_config.json
2
3
{
4
"notice": {
5
"type": "optin",
6
"denyAsPrimary": true
7
}
8
}
Copied!
Expected result:
Disagree & Close button when type is set to optin and denyAsPrimary to true.
You can also display the "Continue without agreeing" link rather than the "Disagree & Close" button by setting the denyAsLink property to true as shown below:
1
didomi_config.json
2
{
3
"notice": {
4
"type": "optin",
5
"denyAsLink": true
6
}
7
}
Copied!
Expected result:
"Continue without agreeing" link when type is set to optin and denyAsLink to true.
The "Continue without agreeing" link has the same behavior as the "Disagree & Close" button.

"Disagree" and legitimate interest

By default, "Disagree & close" and "Continue without agreeing" only apply to consent, not legitimate interest. This means that after this option was selected, purposes based on legitimate interest will still be enabled, and vendors using these purposes will still be enabled for data processing based on legitimate interest.
This behavior can be controlled by setting the denyAppliesToLI property. When set to true, selecting "Disagree & close" or "Continue without agreeing" will disable both consent and legitimate interest based data processing for all purposes and all vendors.
1
didomi_config.json
2
{
3
"notice": {
4
"type": "optin",
5
"denyAppliesToLI": true
6
}
7
}
Copied!

Texts

You can change the message of the notice as well as the "Agree & Close" and "Learn More" buttons.
Configuration Key
Description
notice.content.notice
Message in the banner or popup.
notice.content.dismiss
"Agree & Close" button
notice.content.deny
"Disagree & Close" button
notice.content.learnMore
"Learn More" button
notice.content.privacyPolicy*
"Our Privacy Policy" button
notice.content.viewOurPartners*
"Our partners" button
* Fields marked with asterisk are relevant only for TV SDKs for now
Example:
didomi_config.json
1
{
2
"notice": {
3
"content": {
4
"notice": {
5
"en": "This website uses cookies to provide you with tailored commercial offers",
6
"fr": "Ce site utilise des cookies pour vous fournir des offres commerciales personalisées"
7
},
8
"dismiss": {
9
"en": "Agree & Close",
10
"fr": "Accepter et fermer"
11
},
12
"deny": {
13
"en": "Disagree & Close",
14
"fr": "Refuser et fermer"
15
},
16
"learnMore": {
17
"en": "Learn More",
18
"fr": "En savoir plus"
19
},
20
"privacyPolicy": {
21
"en": "Our Privacy Policy",
22
"fr": "Notre politique de confidentialité"
23
},
24
"viewOurPartners": {
25
"en": "View our partners",
26
"fr": "Voir nos partenaires"
27
}
28
}
29
}
30
}
Copied!
Note that you should provide translations for all the languages that your app supports. We provide translations for all our standard messages.

Vendors and purposes

You must configure the vendors for which consent is collected by our consent notice and displayed in the preferences popup.
Read our detailed section to see how they can be configured.

Window for recollecting consent

By default, consent is automatically re-collected and the notice is displayed in these cases:
    After 13 months (maximum acceptable cookie lifetime)
    When a new vendor is added in the IAB vendors list (if you choose the option all)
The third case (a new vendor is added) can happen pretty often so you have the option to choose a number of days during which the notice will not be displayed even though there are new vendors to collect consent for. By default, the number is zero and the notice will be displayed automatically if a new vendor is added.
During that consent recollection window:
    New users will be asked for consent for the new vendor immediately.
    Previous users that had already given consent within the window (ie less than X days ago) will not be asked again until the expiration of the window. The new vendor will not have consent during that time.
    Previous users that had already given consent outside of the window (ie more than X days ago) will be asked again immediately.
1
{
2
"notice": {
3
"daysBeforeShowingAgain": 5 // Number of days. Default is 0
4
}
5
}
Copied!
If you choose that option and because the notice is not shown again, the user consent status will be partial and some vendors will not have consent information. The function Didomi.isUserConsentStatusPartial() can return true in these cases.

Recollect consent after a certain date

In some cases, you might want to force recollect consent for all users after a certain date, irrespective of their choices and the configured window for recollecting consent.
This can be achieved by setting an ISO8601 date in the user.ignoreConsentBefore property:
1
{
2
"user": {
3
"ignoreConsentBefore": "2020-09-09T00:00:00Z"
4
}
5
}
Copied!
When the user has given consent before the provided date, consent will be automatically recollected. Dates in the future are ignored until they become current so you can schedule a consent recollection for a specific date in the future.

Consent expiration

Didomi CMP allows you to customize the lifetime of the consent so that it expires after a specific time.
You can use app.consentDuration configuration option to specify custom consent duration:
1
{
2
"app": {
3
"consentDuration": 2592000 // Custom consent duration in seconds
4
}
5
}
Copied!
The app.consentDuration configuration option accepts custom consent duration value in seconds.
By default, consent expires after 31,622,400 seconds (approximately 12 months) if custom consent duration is not specified.

Denied consent duration

It is possible to apply a specific consent duration when user denies consent for all purposes and vendors. This is done by setting the app.deniedConsentDuration configuration option.
1
{
2
"app": {
3
"deniedConsentDuration": 1296000 // Denied consent duration in seconds
4
}
5
}
Copied!
If this option is set and user disagrees to consent based data processing for all purposes and vendors (legitimate interest based data processing is ignored), the consent will expire after this time instead of the standard consent duration, and user consent will be asked again.
If user selects "disagree to all" button from notice or from preferences screen, and app.deniedConsentDuration is set, this duration will apply.
app.deniedConsentDuration value should be shorter than app.consentDuration, otherwise it will be ignored.
The app.deniedConsentDuration configuration option accepts custom consent duration value in seconds.
If no value is set, the standard consent duration will still be applied to denied consents.
Last modified 4mo ago