The point here, is to list all your entities with which you will interact in the back-end, regarding of their types.
An entity can be a purpose
, a preference
and a channel
. There is no difference in the structure but those 3 types of entities will have different usage. It will allow you to create consents up to 3 levels. Keep in mind that :
You can create purposes and channels at root level
A purpose can contain multiple preferences and channels
A preference can contains multiple channels
If you phrase it differently, a preference will need to be linked to purpose, a purpose needs to be at root level and channels can be at any level.
An entity object needs to be added in the activeEntities
array of the entities
object and contains 3 attributes to be configured properly:
window.didomiConfig = {containers: [{id: "CONTAINER_1_ID",entities: {activeEntities: [{id: "PURPOSE_1_ID",name: "Purpose 1",description: ""},{id: "PREFERENCE_1_ID",name: "Preference 1",description: ""}]}}]};
Name | Type | Description |
id | String | ID of the entity. It will be used to link the entities together in the layout section and to link them to components if the components section |
name | String|Object | Name of the entity. If can be either a string or an object if you need to handle translations. See this section for more information |
description | String|Object | Description of the entity. If can be either a string or an object if you need to handle translations. See this section for more information |
name
and description
can be either a regular string or an object if you need to handle translations.
window.didomiConfig = {...entities: {activeEntities: [{id: "PURPOSE_ID",name: {en: "English content",fr: "Contenu en Français"}}]}};EN => English contentFR => Contenu en Français
You can manage the desired languages in the Didomi configuration object. See this section for more information
In the case where you have :
Two purposes:
analytics
social_media
Each purpose contains the same preference:
commercial_communication
For analytics
=> commercial_communication
, we want to display 3 channels
email
text
call
For social_media
=> commercial_communication
, we want to display only one channel
email
The list of entities would be :
window.didomiConfig = {...activeEntities: [{id: "analytics",name: "Analytics"},{id: "social_media",name: "Social Media"},{id: "commercial_communication",name: "Commercial communication"},{id: "email",name: "Email"},{id: "text",name: "Text"},{id: "call",name: "Call"},]};
Now let's create this tree of entities which will be representing the hierarchy of our entities.