Deprecated

Notice Config

getDisabledPurposes

Removed since version 2.0.0, use getCurrentUserStatus instead.

getDisabledPurposeIds

Removed since version 2.0.0, use getCurrentUserStatus instead.

getDisabledVendors

Removed since version 2.0.0, use getCurrentUserStatus instead.

getDisabledVendorIds

Removed since version 2.0.0, use getCurrentUserStatus instead.

getEnabledPurposes

Removed since version 2.0.0, use getCurrentUserStatus instead.

getEnabledPurposeIds

Removed since version 2.0.0, use getCurrentUserStatus instead.

getEnabledVendors

Removed since version 2.0.0, use getCurrentUserStatus instead.

getEnabledVendorIds

Removed since version 2.0.0, use getCurrentUserStatus instead.

getRequiredPurposeIds

Removed since version 2.0.0, use getRequiredPurposes instead.

Get the list of purpose IDs that are required (automatically determined from the list of required vendors).

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

TypeDescription

Set<String>

A set of type String containing the IDs of required purposes.

Example

Didomi.getInstance().getRequiredPurposeIds();

getRequiredVendorIds

Removed since version 2.0.0, use getRequiredVendors instead.

Get the list of vendor IDs that are required (determined from the configuration).

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

TypeDescription

Set<String>

A set of type String containing the IDs of required vendors.

Example

Didomi.getInstance().getRequiredVendorIds();


User Status

getUserConsentStatusForPurpose

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserConsentStatusForVendor

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserConsentStatusForVendorAndRequiredPurposes

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserLegitimateInterestStatusForPurpose

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserLegitimateInterestForVendor

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserLegitimateInterestStatusForVendorAndRequiredPurposes

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserStatus

Removed since version 2.0.0, use getCurrentUserStatus instead.

Get all the user consent status.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

A UserStatus object describing all the available and computed user information.

Parameter

Type

Description

purposes.global.disabled

Set<String>

Computed sets/lists of disabled IDs of purposes that have been chosen by the user regarding the consent or legitimate interest Legal Basis.

purposes.global.enabled

Set<String>

Computed sets/lists of enabled IDs of purposes that have been chosen by the user regarding the consent or legitimate interest Legal Basis. Purposes considered as essential will be part of the enabled IDs.

purposes.consent.disabled

Set<String>

Disabled IDs of purposes that have been explicitly chosen by the user regarding the consent Legal Basis.

purposes.consent.enabled

Set<String>

Enabled IDs of purposes that have been explicitly chosen by the user regarding the consent Legal Basis.

purposes.legitimateInterest.disabled

Set<String>

Disabled IDs of purposes that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

purposes.legitimateInterest.enabled

Set<String>

Enabled IDs of purposes that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

purposes.essential

Set<String>

IDs of purposes that are considered essential.

vendors.global.disabled

Set<String>

Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the consent or legitimate interest Legal Basis. This takes into account the consent and legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.global.enabled

Set<String>

Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the consent or legitimate interest Legal Basis. This takes into account the consent and legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalConsent.disabled

Set<String>

Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the consent Legal Basis. This takes into account the consent required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalConsent.enabled

Set<String>

Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the consent Legal Basis. This takes into account the consent required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalLegitimateInterest.disabled

Set<String>

Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the legitimate interest Legal Basis. This takes into account the legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalLegitimateInterest.enabled

Set<String>

Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the legitimate interest Legal Basis. This takes into account the legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.consent.disabled

Set<String>

Disabled IDs of vendors that have been explicitly chosen by the user regarding the consent Legal Basis.

vendors.consent.enabled

Set<String>

Enabled IDs of vendors that have been explicitly chosen by the user regarding the consent Legal Basis.

vendors.legitimateInterest.disabled

Set<String>

Disabled IDs of vendors that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

vendors.legitimateInterest.enabled

Set<String>

Enabled IDs of vendors that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

userId

String

Didomi user id.

created

String

User choices creation date.

updated

String

User choices update date.

consentString

String

TFC consent as string.

additionalConsent

String

Additional consent for Google Additional Consent Mode.

regulation

Regulation

Representation of the current regulation as a Regulation enum value, such as GDPR, CCPA, CPRA, or NONE. Note that some regulations present as enum values are not available yet.

Example

UserStatus userStatus = Didomi.getInstance().getUserStatus();

// Enabled consent ids for vendors
Set<String> enabledVendorsConsentIds = userStatus.getVendors().getConsent().getEnabled();

getUserStatusForVendor

Removed since version 2.0.0, use getCurrentUserStatus instead.

isConsentRequired

Removed since version 2.0.0, use shouldUserStatusBeCollected instead.

Determine if consent is required for the user. This takes into account the location of the user and the configuration of the SDK:

  • If your app is configured to apply GDPR to all users then this function always returns true.

  • If your app is configured to apply GDPR to EU users only then this function returns true only if the user in the EU.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

boolean

Example

Didomi.getInstance().isConsentRequired();

isUserConsentStatusPartial

Deprecated, use isUserStatusPartial instead.

Determine if all consent information is available for the user.

This function returns true if and only if:

  • Consent is required for the user (ie the user is in the EU or your tag is configured to apply GDPR to all users)

  • At least one vendor is configured (if there is no vendor configured, this function always returns false as there is no consent to collect)

  • We miss consent information for some vendors or purposes

If there is at least one piece of consent information missing for a single vendor/purpose, this function will return true. The consent notice is usually displayed when this function returns true although there is no guarantee of the direct mapping between the two.

An important edge case is when you add new vendors or if configured vendors ask for new purposes: the consent notice will be displayed again and this function will return 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.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

boolean

Example

Didomi.getInstance().isUserConsentStatusPartial();

isUserLegitimateInterestStatusPartial

Deprecated, use isUserStatusPartial instead.

Determine if all Legitimate Interest information is available for the user.

This function returns true if and only if:

  • Legitimate Interest is required for the user (ie the user is in the EU or your tag is configured to apply GDPR to all users)

  • At least one vendor is configured (if there is no vendor configured, this function always returns false as there is no Legitimate Interest to collect)

  • We miss Legitimate Interest information for some vendors or purposes

If there is at least one piece of Legitimate Interest information missing for a single vendor/purpose, this function will return true. The consent notice is usually displayed when this function returns true although there is no guarantee of the direct mapping between the two.

An important edge case is when you add new vendors or if configured vendors ask for new purposes: the consent notice will be displayed again and this function will return true until the user has given or denied consent. Vendors that already had Legitimate Interest before will still operate normally as we only recollect Legitimate Interest for additional vendors/purposes.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

boolean

Example

Didomi.getInstance().isUserLegitimateInterestStatusPartial();

setUserConsentStatus

Deprecated, use method setUserStatus with same signature instead

setUserStatus

Removed since version 2.0.0, use setCurrentUserStatus instead.

Set the user status for purposes and vendors. This function will trigger events and API calls every time it is called (and the user status changes) so make sure to push all user choices at once and not one by one.

Please read our article on what to expect from your analytics when setting a custom behavior for your consent notice.

Parameters

Global method:

Define a global status for consent purposes, legitimate interest purposes, consent vendors, legitimate interest vendors

NameTypeDescription

purposesConsentStatus

boolean

true if purposes on a consent basis should be enabled, false if they should be disabled

purposesLIStatus

boolean

true if purposes on a legitimate interest basis should be enabled, false if they should be disabled

vendorsConsentStatus

boolean

true if vendors on a consent basis should be enabled, false if they should be disabled

vendorsLIStatus

boolean

true if vendors on a legitimate interest basis should be enabled, false if they should be disabled

Example

// Disable everything except vendors legitimate interest
Didomi.getInstance().setUserStatus(
    false, true, false, true
);

Individual purposes/vendors method:

Allows to define precisely which purposes and vendors are enabled / disabled

NameTypeDescription

enabledConsentPurposeIds

Set<String>

Set of purpose IDs that the user has given consent to

disabledConsentPurposeIds

Set<String>

Set of purpose IDs that the user has not given consent to

enabledLIPurposeIds

Set<String>

Set of purpose IDs that the user has allowed legitimate interest processing to

disabledLIPurposeIds

Set<String>

Set of purpose IDs that the user has disallowed legitimate interest processing to

enabledConsentVendorIds

Set<String>

Set of vendor IDs that the user has given consent to.

Prefix custom vendor IDs with c:.

disabledConsentVendorIds

Set<String>

Set of vendor IDs that the user has not given consent to

enabledLIVendorIds

Set<String>

Set of vendor IDs that the user has allowed legitimate interest processing to.

Prefix custom vendor IDs with c:.

disabledLIVendorIds

Set<String>

Set of vendor IDs that the user has not allowed legitimate interest processing to

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

boolean

true if the user choices have changed (i.e. the user had made different choices before this function got called).

Example

Didomi.getInstance().setUserStatus(
    new HashSet<String>(Arrays.asList("cookies", "ad_delivery")),
    new HashSet<String>(Arrays.asList("market_research")),
    new HashSet<String>(Arrays.asList("cookies", "market_research"),
    new HashSet<String>(Arrays.asList("ad_delivery"),
    new HashSet<String>(Arrays.asList("123", "c:custom-vendor-id")),
    new HashSet<String>(Arrays.asList("125")),
    new HashSet<String>(Arrays.asList("123", "125", "c:custom-vendor-id")),
    new HashSet<String>()
);

shouldConsentBeCollected

Deprecated, use shouldUserStatusBeCollected instead.

Determine if consent should be collected for the visitor. Returns true if consent is required for the current user and one of following two conditions is met:

  • Consent has never been collected for this visitor yet

  • New consents should be collected (as new vendors have been added) AND the number of days before recollecting them has exceeded

If none of these two conditions is met, the function returns false. This function is mainly present to allow you to know when to display your own notice if you have disabled our standard notice.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

boolean

Example

Didomi.getInstance().shouldConsentBeCollected();

Last updated