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:

Custom JSON
{
    "app": {
        "gdprAppliesGlobally": true,
        "gdprAppliesWhenUnknown": true
    }
}

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:

Custom JSON
{
    "app": {
        "country": "ES"
    }
}

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:

Custom JSON
{
  "languages": {
    "enabled": ['en', 'fr'],
    "default": 'fr'
  }
}

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:

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:

Examples:

Custom JSON
{
  "notice": {
    "position": "bottom"
  }
}

Disagree & Close

You can enable the "Disagree & Close" option from the notice by setting the denyOptions property. In this case, the "Learn More" button will be shown as a link.

To show a button containing the "Disagree & Close" text, set the denyOptions.button property to primary or secondary. Default is none. Note that on TV, the Disagree & Close button will always be displayed with the same style, whether the property is set to primary or secondary.

Disagree & Close as primary

You can show the "Disagree & Close" button styled as a primary button by setting the denyOptions.button to primary as shown below:

Custom JSON
{
    "notice": {
        "denyOptions": {
            "button": "primary"
        }
    }
}

Expected result:

Disagree & Close as secondary

On mobile, you can show the "Disagree & Close" button styled as a secondary button by setting the denyOptions.button to secondary as shown below:

Custom JSON
{
    "notice": {
        "denyOptions": {
            "button": "secondary"
        }
    }
}

Expected result:

Remove Disagree & Close button

To make sure the "Disagree & Close" button is not displayed, you can disable it by setting denyOptions.button to none, as shown below:

Custom JSON
{
    "notice": {
        "denyOptions": {
            "button": "none"
        }
    }
}

On mobile, you can also display a "Continue without agreeing" link rather than the "Disagree & Close" button by setting the denyOptions.link property to true and denyOptions.button to none, as shown below:

Custom JSON
{
    "notice": {
        "denyOptions": {
            "link": true,
            "button": "none"
        }
    }
}

Expected result:

The "Continue without agreeing" link has the same behavior as the "Disagree & Close" button.

Close cross (mobile)

In order to comply with Italian regulations, you should display a cross allowing users to close the notice. On mobile, you can display a cross instead of the "Continue without agreeing" link by setting the denyOptions.cross property to true and denyOptions.button to none, as shown below:

Custom JSON
{
    "notice": {
        "denyOptions": {
            "cross": true,
            "button": "none"
        }
    }
}

Expected result:

The cross 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..json

Custom JSON
{
    "notice": {
        "denyOptions": {
            "button": "primary"
        },
        "denyAppliesToLI": true
    }
}

Texts

You can change the message of the notice as well as the "Agree & Close" and "Learn More" buttons.

* Fields marked with asterisk are relevant only for TV SDKs for now

Example:

didomi_config.json
{
  "notice": {
    "content": {
      "notice": {
        "en": "This website uses cookies to provide you with tailored commercial offers",
        "fr": "Ce site utilise des cookies pour vous fournir des offres commerciales personalisées"
      },
      "dismiss": {
        "en": "Agree & Close",
        "fr": "Accepter et fermer"
      },
      "deny": {
        "en": "Disagree & Close",
        "fr": "Refuser et fermer"
      },
      "learnMore": {
        "en": "Learn More",
        "fr": "En savoir plus"
      },
      "privacyPolicy": {
        "en": "Our Privacy Policy",
        "fr": "Notre politique de confidentialité"
      },
      "viewOurPartners": {
        "en": "View our partners",
        "fr": "Voir nos partenaires"
      }
    }
  }
}

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.

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.

{
    "notice": {
        "daysBeforeShowingAgain": 5 // Number of days. Default is 0
    }
 } 

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.

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:

{
    "user": {
       "ignoreConsentBefore": "2020-09-09T00:00:00Z"
    }
}

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.

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:

{
    "app": {
        "consentDuration": 2592000 // Custom consent duration in seconds
    }
}

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.

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.

{
    "app": {
        "deniedConsentDuration": 1296000 // Denied consent duration in seconds
    }
}

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 updated