Events
The Didomi SDK triggers various events to notify you that the user has taken some action (changed their consent status, open the preferences screen, etc.) or that an important event has happened.
This section describes what events are available and how to subscribe to them.
addEventListener
Add an event listener to catch events triggered by the SDK. Events listeners allow you to react to different events of interest. This function is safe to call before the ready
event has been triggered.
Requires SDK to be initialized
No.
Parameters
Name | Type | Description |
eventListener |
| The event listener. An instance of a subclass of |
Returns
Nothing
Example
Event types
The following events are supported by the Didomi SDK:
Method | Description |
onConsentChanged | When a consent is given or withdrawn by the user. Only triggered when the consent status actually changes (ie if the user saves consents without adding/removing any consent then this does not get called). |
onHideNotice | When the consent notice is hidden. If you have disabled our default consent notice to replace it with your own, you need to hide your custom notice when this event gets triggered. |
onShowNotice | When the consent notice gets displayed. If you have disabled our default consent notices to replace them with your own, you need to show your custom notice when this event gets triggered. |
onNoticeClickAgree | When user clicks on agree on the notice |
onNoticeClickMoreInfo | When user clicks on learn more on the notice |
onHidePreferences | When the preferences screen becomes hidden, for example when user closed it or saved their consent. |
onShowPreferences | When the preferences screen gets displayed. |
onPreferencesClickAgreeToAll | When user clicks on agree to all on the preferences popup |
onPreferencesClickDisagreeToAll | When user clicks on disagree to all on the preferences popup |
onPreferencesClickPurposeAgree | When user agree to a purpose on the preferences popup. ( |
onPreferencesClickPurposeDisagree | When user disagree to a purpose on the preferences popup. ( |
onPreferencesClickViewVendors | When user clicks on view vendors on the preferences popup |
onPreferencesClickViewSPIPurposes | When user clicks on view Sensitive Personal Information from the preferences popup |
onPreferencesClickSaveChoices | When user saves his choice on the preferences popup |
onPreferencesClickVendorAgree | When user agree to a vendor on the preferences popup. ( |
onPreferencesClickVendorDisagree | When user disagree to a vendor on the preferences popup. ( |
onPreferencesClickVendorSaveChoices | When user saves his choice on the vendors view on the preferences popup |
onNoticeClickDisagree | When user clicks on disagree on the notice |
onNoticeClickViewVendors | When user clicks on partners on the notice |
onNoticeClickViewSPIPurposes | When user clicks on Sensitive Personal Information from the notice |
onNoticeClickPrivacyPolicy | When user clicks on privacy policy on the notice (available on TV only) |
onPreferencesClickAgreeToAllPurposes | When user flips ON all purposes switch on the preferences popup |
onPreferencesClickDisagreeToAllPurposes | When user flips OFF all purposes switch on the preferences popup |
onPreferencesClickAgreeToAllVendors | When user flips ON all vendors switch on the preferences popup |
onPreferencesClickDisagreeToAllVendors | When user flips OFF all vendors switch on the preferences popup |
onPreferencesClickViewPurposes | When user clicks on view purposes on the preferences popup |
onPreferencesClickSPIPurposeAgree | When the toggle linked to an Personal Data purpose is set to agree/enabled |
onPreferencesClickSPIPurposeDisagree | When the toggle linked to an Personal Data purpose is set to disagree/disabled |
onPreferencesClickSPICategoryAgree | When the toggle linked to an Personal Data category is set to agree/enabled |
onPreferencesClickSPICategoryDisagree | When the toggle linked to an Personal Data category is set to disagree/disabled |
onPreferencesClickSPIPurposeSaveChoices | When the Save button from the Sensitive Personal Information screen is pressed |
onSyncDone | When the consent synchronization is successful (Cross-device) |
onSyncError | When the consent synchronization has failed (Cross-device) |
onLanguageUpdated | When SDK language has been successfully changed. ( |
onLanguageUpdateFailed | When SDK language update has failed. ( |
Last updated