Active Entities

What is an entity?

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.

Where do I add my entities?

An entity object needs to be added in the activeEntities array of the entities object and contains 3 attributes to be configured properly:
1
window.didomiConfig = {
2
containers: [
3
{
4
id: "CONTAINER_1_ID",
5
entities: {
6
activeEntities: [
7
{
8
id: "PURPOSE_1_ID",
9
name: "Purpose 1",
10
description: ""
11
},
12
{
13
id: "PREFERENCE_1_ID",
14
name: "Preference 1",
15
description: ""
16
}
17
]
18
}
19
}
20
]
21
};
Copied!

Props

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

Translation support

name and description can be either a regular string or an object if you need to handle translations.
1
window.didomiConfig = {
2
...
3
entities: {
4
activeEntities: [
5
{
6
id: "PURPOSE_ID",
7
name: {
8
en: "English content",
9
fr: "Contenu en Français"
10
}
11
}
12
]
13
}
14
};
15
EN => English content
16
FR => Contenu en Français
Copied!
You can manage the desired languages in the Didomi configuration object. See this section for more information

Example

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 :
1
window.didomiConfig = {
2
...
3
activeEntities: [
4
{
5
id: "analytics",
6
name: "Analytics"
7
},
8
{
9
id: "social_media",
10
name: "Social Media"
11
},
12
{
13
id: "commercial_communication",
14
name: "Commercial communication"
15
},
16
{
17
id: "email",
18
name: "Email"
19
},
20
{
21
id: "text",
22
name: "Text"
23
},
24
{
25
id: "call",
26
name: "Call"
27
},
28
]
29
};
Copied!
Now let's create this tree of entities which will be representing the hierarchy of our entities.
Last modified 1yr ago