Customize the preferences popup
Last updated
Last updated
The "Preferences" pop-in allows the user to manage his or her preferences in terms of consent given by purpose and by vendor. By default, it is shown when the user clicks on "Learn more" in the notice (banner or popin) and we recommend adding a link in your app to open it.
You can customize the texts from that screen.
You can control how purposes should be displayed, such as preferred order, icons, etc.
This can be done by adding an array of purposes in the preferences.categories
property in the didomi_config.json
file. The order in which items are added to this array will be the same order in which purposes will be displayed in based on their purposeId
.
Purposes that are required by some vendors and that are not included in the list will be appended to the end of the list in alphabetical order to make sure that all required purposes are displayed and that consent is correctly collected.
Configuration Key
Type
Description
preferences.categories[index].type
String
Type of the entity to be displayed. If you are specifying the purpose, this key should have purpose
value
preferences.categories[index].purposeId
String
Purpose ID to be displayed in that position. See Vendors and purposes for a list of available purposes.
preferences.categories[index].icon
String
Reference to an icon image loaded from the app.
Purposes having a similar functionality can be optionally grouped into categories. This could be useful for better clarity of the purposes screen.
To group purposes into categories, preferences.categories
configuration option in the Didomi configuration could be used:
Purposes that are required by some vendors and that are not included in one of the specified categories will be appended to the end of the purposes list in alphabetical order so that all required purposes are displayed and that consent is correctly collected for them.
Each category has the following configuration keys:
Configuration Key
Type
Description
category.id
String
Unique category identifier
category.name
Object
An object containing language ISO code as keys and the localized category name as values
category.description
Object
An object containing language ISO code as keys and the localized category description as values
category.children
Array
An array of purposes which are included in the specified category
category.type
String
Type of the entity to be displayed. If you are specifying the category, this key should have category
value
If the user has agreed to the whole category, the PreferencesClickCategoryAgreeEvent
Didomi event will be dispatched. Similarly, if the user has disagreed to the whole category, the PreferencesClickCategoryDisagreeEvent
Didomi event will be dispatched.
You can change the content of the popup by setting properties on preferences.content
.
Configuration Key
Description
preferences.content.text
Main content of the popup
preferences.content.title
Title of the popup (Welcome to ...)
preferences.content.disagreeToAll
'Disagree to all' button
preferences.content.agreeToAll
'Agree to all' button
preferences.content.save
'Save' button
preferences.content.viewOurPartners*
'View our partners' button
preferences.content.viewAllPurposes*
'How we use data' button
preferences.content.bulkActionOnPurposes*
'Agree to all purposes for the best experience' button
preferences.content.bulkActionOnVendors*
'Agree to all vendors for the best experience' button
* Fields marked with asterisk are relevant only for TV SDKs for now
You can change the content of the popup by setting properties on preferences.content
.
Configuration Key
Description
preferences.content.textVendors
Main content of the popup
If you want to bypass the notice and display the Preferences popup directly when consent is missing, you can set the property preferences.showWhenConsentIsMissing
to true. When that is configured, you also need to disable the regular notice to ensure that it will not be displayed by setting notice.enable
to false.
By default, the Preferences popup can be closed at any time, even if the user has not made a choice for some purposes. You can choose to hide the "X" icon and disallow closing the popup until the user has expressed a choice for every purpose by setting canCloseWhenConsentIsMissing
to false
.
By adding the disableButtonsUntilScroll
flag into the preferences section of the config file and setting it to true
, the Agree to all
and Disagree to all
buttons of the Purposes view will be blocked/disabled until the user scrolls to the bottom of the screen in order to see all the purposes.
Configuration key
Type
Description
preferences.disableButtonsUntilScroll
Boolean
If true, Agree to all and disagree to all buttons will be disabled until the user scrolls to the bottom. If false or not present, the buttons will not be blocked.
By default, "Disagree to all" option on preferences screen applies to both consent and legitimate interest. This means that after "Disagree to all" was selected, all purposes and vendors will be disabled, for both consent and legitimate interest data processing.
This behavior can be controlled by setting the denyAppliesToLI
property. When set to false
, selecting "Disagree to all" will disable only consent based data processing. Legitimate interest purposes will stil be enabled, as well as legitimate interest based data processing for all vendors.