Behavior

Window for recollecting consent

By default, consent is automatically re-collected and the notice is displayed again in three cases:

  • After 13 months (maximum acceptable cookie lifetime)

  • When the user clears they browser cookies

  • When a new vendor is added in your tag configuration or 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. If you create notices through the Didomi Console, the default value is 30 days.

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 vendor 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.

<script type="text/javascript">
window.didomiConfig = {
notice: {
daysBeforeShowingAgain: 5 // Number of days. Default is 0
}
};
</script>

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.

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.

Configuration by user country

If you want to apply a different configuration depending on the country that the user is from, you can add country-specific properties in a configByCountry property where each key is a ISO 3166-1 alpha-2 country code in uppercase (the country code is case-sensitive). This allows you to replace part or all of the configuration for some countries.

Example to force the language based on the user country instead of the user browser configuration, and modify vendors:

<script type="text/javascript">
window.didomiConfig = {
// Visitors from countries other than FR or US will get this configuration
languages: {
enabled: ['fr', 'en'], // Enable both French and English for all users
},
app: {
name: 'My Website',
vendors: {
iab: {
all: true,
exclude: [9],
}
}
},
configByCountry: {
// Visitors from France will get the global configuration + these changes applied to it
FR: {
languages: {
enabled: ['fr'] // Force French for visitors from France
},
app: {
vendors: {
iab: {
all: false,
include: [9],
exclude: [] // It's important to override "exclude" here otherwise it would be kept as [9]
}
}
}
},
// Visitors from the US will get the global configuration + these changes applied to it
US: {
languages: {
enabled: ['en'] // Force English for visitors from the US
}
// Vendors are not specified here so the global vendors will apply (all IAB)
}
}
};
</script>

The properties defined in configByCountry are merged with the rest of the configuration when the user comes from the matching country. The properties from the country configuration override the properties defined globally and are merged recursively so make sure to fully override objects when necessary. Arrays are replaced and not merged or concatenated.