Events & Variables
Events are pushed by the Didomi Web SDK to your tag management system. Events provide variables that contain the user status on vendors and purposes.
You can then setup your rules based on events and variables to decide whether a tag can be loaded or not directly from your tag manager.
Events
didomi-ready
: This event is pushed exactly once when the page is loaded and can be used for any tag that you want to fire exactly once on the page. The status of the user at the time of this event might be unknown.didomi-consent-changed
: This event is pushed every time the user status changes as the result of a user interacting with the Didomi consent notices or preferences.didomi-consent
: This event is pushed once when the page is loaded and then every time the user status changes as the result of a user interacting with the Didomi consent notices or preferences. Because this event does not distinguish between a page load and a subsequent status change, it can be fired multiple times on the page and is not suited for tags that must be fired at most once. You will usually want to use a combination of thedidomi-ready
anddidomi-consent-changed
events instead for these cases.
Variables
Vendors
These variables provide the user status for the vendors configured in your notice.
The user status reported for vendors automatically includes the status for their required purposes. You usually do not have to create a trigger that uses both vendors AND purposes variables: a trigger on vendors is enough.
Example: the vendor ID google
is only included in the list of enabled vendors, if the user has enabled google
and every purpose required by that vendor.
didomiVendorsEnabled
Contains IDs of vendors that are 1) enabled for all their legal bases AND 2) all the defined purposes for the vendor are enabled for all their legal bases.
didomiVendorsEnabled
also contains any vendor defined with essential purposes only.When no regulation applies to the user,
didomiVendorsEnabled
contains all vendors defined in your notice configuration.
didomiVendorsDisabled
Contains IDs of vendors that are either directly disabled by the user OR at least one of their defined purposes is disabled for any legal basis.
When no regulation applies to the user,
didomiVendorsDisabled
is empty.
didomiVendorsUnknown
Contains IDs of vendors that are neither enabled nor disabled (i.e: user has not made a choice and there is no default status for the legal basis).
When no regulation applies to the current user,
didomiVendorsUnknown
is empty.
Vendor IDs
All variables have the same format: a comma-separated list of vendor IDs terminated by a final comma.
To find your vendor ID, navigate to the Didomi Console -> Consent notices -> Open your notice -> Regulation -> Edit vendors and Purposes: Use the API ID.
Vendor IDs are unique and are the same across all regulations and notices.
Purposes
These variables contain the user status for the purposes configured in your notice.
You usually do not need to use these variables directly and want to use the vendors variables instead.
All variables have the same format: a comma-separated list of purpose IDs terminated by a final comma. Example: cookies,analytics,
Variable
Description
didomiPurposesEnabled
List of purposes that are enabled in all the legal bases for which they are defined.
didomiPurposesEnabled
also contains any purpose defined as essential on your consent notice.When no regulation applies to the user,
didomiPurposesEnabled
contains all purposes defined in your notice configuration.
didomiPurposesDisabled
List of purposes that are disabled in any of the legal bases for which they were defined.
When no regulation applies to the current user,
didomiPurposesDisabled
is empty.
AB tests
We expose variables that contain the status of the AB test running (if any). That allows you to track your AB tests results through your own analytics solution.
Variable
Description
Values / Example
didomiExperimentId
ID of the AB test running.
The value of the experiment.id
property in your SDK configuration. An empty string is provided if there is no test configured.
didomiExperimentUserGroup
The group that the user is a part of.
control
if the user is part of the control group
test
if the user is part of the user group
An empty string is provided if the user is not part of the control or test group.
GDPR & IAB
Variable
Description
Values / Example
didomiGDPRApplies
Define whether the GDPR applies to the current user (ie the user is located in the EU or your website is configured to enforce GDPR for all users).
0
(GDPR does not apply) and 1
(GDPR does apply)
didomiIABConsent
The IAB consent string as defined in the Consent String and Vendor List Format specification. It encodes the consent information for every vendor and purpose as well as few other pieces of information on the CMP that created the string.
BOMi0lyOMi0lyAHABBENAC-AAAAB4AQABaA
Last updated