window.Didomi
object. All calls to the Didomi API (except for the standard IAB __cmp
function) must be enclosed within a window.didomiOnReady
callback to ensure that the SDK is ready before calling it:window.didomiOnReady
callbacks are called after the SDK is initialized and has loaded its configuration.window.didomiConfig
in a window.didomiOnReady
callback has no effect as the SDK is already initialized at that point. window.didomiConfig
must be set at the root of the page and outside of any callback.postMessage
API of the browser.command
is the name of the function on the window.Didomi
object to callparameter
is an array of parameters passed to the function called on the window.Didomi
objectcallId
is a unique value that will be sent back with the response from Didomi, allowing you to identify what call the response is forpostMessage
API containing a response for your command where:returnValue
is the value returned by the API function calledsuccess
is a boolean flag indicating whether the call was successful or notcallId
is the unique value provided as callId
in your original messagegetUserConsentStatus
) and collect its response:postMessage
to can be determined by the ancestor with a .frames["cmpLocator"]
child iframe present.window.Didomi
object then you can simply use window.parent as the reference to send messages to.window.Didomi
object, you can search for the correct frame to send a message to with the following code:string
string
control
if the user is part of the control grouptest
if the user is part of the test groupnull
if the user is not part of the experimentnumber
string
string
gdpr
for GDPRccpa
for CCPAboolean
indicating whether the user is subject to the regulation and support for the regulation is enabled for the website.didomiConfig
to your page:window.didomiConfig
must be set outside of any callback like window.didomiOnReady
to be effective.string
button
parameter can take one of the following values:confirm
cancel
up
right
down
left
Boolean
string
information, purposes
and vendors
. (information
will only work if you enabled the information view).
For CCPA, the Do Not Sell view is always open.
purposes
view or the information
view if information is enabled for GDPR.__cmp
function and listen to postMessage
events as per the specification.__tcfapi
function and listen to postMessage
events as per the specification.consent.changed
event that helps in dealing with vendor-specific operations.string
c:
.Observable
on the consent status of the vendor.undefined
. If the user has already given consent, your function will get called with the consent status from the user.undefined
.string
cookies
)string
"c:"
.boolean
that indicates if the user has given consent or not.true
if the specified purpose is an essential purpose and if the specified vendor has consent.string
boolean
that indicates if the user has given consent or not to the specific purpose.undefined
is returned if the consent status is not known yet. From a GDPR perspective, you'll want to treat undefined
as false
(ie no consent given) but it is helpful to know that the user has not interacted with the consent UI yet so that you can subscribe to events and wait for consent information to be collected.true
if the specified purpose is an essential purpose.string
c:
.boolean
that indicates if the user has given consent or not to the specific vendor and all the purposes that require consent for that vendor.undefined
is returned if the consent status is not known yet. From a GDPR perspective, you'll want to treat undefined
as false
(ie no consent given) but it is helpful to know that the user has not interacted with the consent UI yet so that you can subscribe to events and wait for consent information to be collected.user_id
), the TCF consent string (consent_string
), additional consent string from Google's additional consent mode (addtl_consent
) and the dates of the user choices (created
and updated
ISO8061 dates).Boolean
true
if and only if:false
as there is no consent to collect)true
. The consent notice is usually displayed when this function returns true
although there is no guarantee of the direct mapping between the two.true
until the user has given or denied consent. Vendors that already had consent before will still operate normally as we only recollect consent for additional vendors/purposes.Boolean
Transaction
object that contain the current consents. You can then modify them with the functions below.Didomi.getUserStatus()
purposes.consent.enabled
array
purposes.consent.disabled
array
purposes.legitimate_interest.enabled
array
purposes.legitimate_interest.disabled
array
vendors.consent.enabled
array
vendors.consent.disabled
array
vendors.legitimate_interest.enabled
array
vendors.legitimate_interest.disabled
array
created
ISO8601 date
updated
ISO8601 date
action
string
Didomi.getUserStatus()
purposesConsentStatus
boolean
purposesLIStatus
boolean
vendorsConsentStatus
boolean
vendorsLIStatus
boolean
created
ISO8601 date
updated
ISO8601 date
action
string
true
if consent is required for the current user and one of following two conditions is met:false
.
This function is mainly present to allow you to know when to display your own notice if you have disabled our standard notice.Boolean
boolean
true
if the user has opted out of data sharing.false
if the user has not opted out of data sharing (default).Boolean