Didomi - Developers documentation
  • Introduction
  • SDKs
    • Introduction
    • Web SDK
      • Getting started
      • Tags and vendors management
        • Tags management
          • Events & Variables
            • Deprecated
            • Custom events
          • Tag managers
            • Adobe Launch/DTM
            • Eulerian
            • Google Tag Manager
              • Configure the Didomi / GTM integration
              • Didomi's GTM template
            • Tealium
            • Other tag managers
        • Custom Didomi <script> tags
        • Third-party integrations
          • Google Ad Manager / AdSense
            • GDPR via Non-Personalized Ads
              • Share consent and load/refresh ads
              • Share consent without loading or refreshing ads
            • US states laws
          • Google Consent Mode V2
          • Kameleoon
          • Piano Analytics (AT Internet)
          • Prebid
            • GDPR via IAB TCF
            • US states laws
          • Salesforce DMP (Krux)
        • IAB frameworks
        • Programmatic API
      • Configuration
        • Bots (SEO & Performance tools)
        • Configuration by URL
        • Cookies and storage
        • Custom domains for events
        • Notice
          • Behavior
          • Interactions
          • Look and feel
        • Preferences
        • Theme
      • AB tests
      • Custom domain
        • Domain delegation
        • Reverse proxy
      • Share consents between domains
      • Share consents across devices
      • Pass user choices in query string
      • Serve Didomi assets from your domain
      • Reference
        • API
          • Deprecated
        • Events
      • Performance
      • Versions
    • Mobile and TV SDKs
      • Android and Android TV
        • Setup
        • Logging
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • iOS and tvOS
        • Setup
        • Logging
        • App Tracking Transparency (iOS 14.5+)
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • Unity
        • Setup
        • Reference
        • Versions
        • Troubleshooting
      • React Native
        • Setup
        • Reference
          • Deprecated
        • Versions
      • Flutter
        • Setup
        • Reference
        • Versions
      • Consent notice
        • Getting started
        • Customize the notice
        • Customize the preferences popup
        • Customize the theme & UI
        • Load notice by ID
      • Third-party SDKs
      • Share consents across devices
      • Share consent with WebViews
      • Google Consent Mode v2
      • FAQ
    • AMP SDK
      • Blocking Behaviors
        • Load immediately on page load
        • Load only after consent (positive or negative)
        • Load only after positive consent
      • Consent status for vendors
    • Help & Support
  • API
    • Introduction
      • Authentication
      • Errors
      • Pagination
      • Filters
      • Caching
      • Rate limiting
      • Quotas
      • Translations
    • Data Manager
      • Regulations
      • Configuration Tree
      • Purposes
        • Purposes & Vendors Numerical IDs
      • Preferences Library
      • User Rights
    • Widgets
      • Consent notices
        • Notices
        • Configurations
        • Multi-Regulation Configurations
          • Migration of Existing Notices and API Updates
        • Deployments
        • Tutorials
          • Create and publish a consent notice
          • Create and publish a multi-regulation consent notice
      • Privacy widgets
        • Create a widget
        • Retrieve widgets
        • Edit a widget
          • Content & Design
            • Themes & Shapes
            • Components
              • auth
              • dsar_form
              • footer
              • header
              • preference
              • preference_value
              • save
              • section
              • sections
            • Options
          • Purposes & preferences
          • Settings
        • Deploy a Widget
          • Use your own subdomain
          • Use your own domain
          • Implement an embeddable widget on your website
        • Authentication
          • Manage authentication providers
          • Authenticate your end-user
        • Archive a widget
        • Headless widgets
          • Public Methods
          • Custom elements
          • Custom events
          • Event listeners
        • Tutorial
          • Launch a Preference Center from a mobile app
    • Compliance Reports
      • Properties
      • Reports
      • CSV format reference
      • Websites
    • Consents and Preferences
      • Events
        • Generate IAB TCF consent string
      • Links
      • Proofs
      • Tokens
      • Secrets
      • Users
      • Tutorial
        • Collect and operate data
    • Privacy Requests
      • Requests
      • Notes
      • Links
      • Emails
  • Integrations
    • Introduction
      • Quotas
    • Generic integrations
      • Batch export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
        • Exported data
          • Notices consents
        • Logs
      • Webhooks
      • Batch import
      • Analytics export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
    • Third-party apps
      • CMP integrations
        • Didomi-mParticle integration for your CMP
        • Deploy Didomi’s SDK for your Adobe Commerce website
      • Preference Management Platform integrations
        • Actito
        • Adobe Campaign Classic
        • Adobe Experience Cloud
        • Adobe Marketo Engage
        • Adobe Source Connector
        • Braze
        • Dotdigital
        • Hubspot
        • Mailchimp
        • Microsoft Dynamics 365
        • Salesforce Marketing Cloud
        • Salesforce Sales & Service Cloud
        • Selligent
        • Brevo (ex Sendinblue)
    • Tutorials
      • Configure a HTTP webhook
      • Configure a batch export
      • Configure an analytics export
    • Emailing
      • Configurations
        • Actito Email
        • Actito SMS
        • Adobe Campaign Classic
        • Adobe Campaign Standard
      • Emails
        • Templates
        • Manage your templates
Powered by GitBook
On this page
  • Event listeners
  • didomiEventListeners (Recommended)
  • Didomi.on
  • Didomi.once
  • Didomi.off
  • React
  • Event types
  • api.error
  • consent.changed
  • consent.pendingchanged (Currently only used for preference center)
  • integrations.consentpassedtodfp
  • notice.backdropclick
  • notice.clickagree
  • notice.clickclose
  • notice.clickdisagree
  • notice.clickmoreinfo
  • notice.clickviewvendors
  • notice.hidden
  • notice.shown
  • preferences.clickagreetoall
  • preferences.clickclose
  • preferences.clickdisagreetoall
  • preferences.clickpurposeagree
  • preferences.clickpurposedisagree
  • preferences.clicksavechoices
  • preferences.clickvendoragree
  • preferences.clickvendordisagree
  • preferences.clickvendorsavechoices
  • preferences.clickviewvendors
  • preferences.hidden
  • preferences.shown
  • sync.ready
  1. SDKs
  2. Web SDK
  3. Reference

Events

The Didomi SDK triggers various events to notify you that the user has taken some action (changed their consent status, opened the preferences pop-in, etc.) or that an important event has happened.

This section describes what events are available and how to subscribe to them.

Event listeners

The Didomi SDK supports three methods for registering event listeners:

didomiEventListeners (Recommended)

You can register events by adding them to the special window.didomiEventListeners array:

<script type="text/javascript">
window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'event.type',
  listener: function () {
    // Your event listener
  }
});

window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function () {
  // Your initialization code (if any)
});
</script>

...

// Embed the Didomi SDK on the page
<script type="text/javascript" src="https://sdk.privacy-center.org/loader.js" async="true"></script>

When the SDK initializes, it collects event listeners from that array and registers them. You must add your event listeners to that array before the SDK gets embedded on the page and before it is ready to guarantee that you do not miss an event. You can also add event listeners to that array after the SDK is loaded and the SDK will automatically pick them up but you will miss events that happen during the SDK initialization.

This is the preferred method of registering event listeners as it guarantees that you do not miss events.

Registering your event listeners should be done outside of the window.didomiOnReady callback to ensure that you receive all events.

If you register events within the window.didomiOnReady callback, you will miss some events like the very first notice.shown that is sent before the window.didomiOnReady callback gets fired.

Didomi.on

The SDK also allows you to register event listeners with the Didomi.on method exposed in its API:

window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function () {
  Didomi.on('event.type', function () {
    // Your event listener
  });
});

Didomi.once

Additionally, the SDK provides the Didomi.once method to register single-use event listeners:

window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function () {
  Didomi.once('event.type', function () {
    // Your event listener, executed only once
  });
});

While these methods are perfectly valid, their main drawback is that your event listeners only get registered once the SDK is ready, meaning you will miss events fired during the SDK initialization. We recommend using the didomiEventListeners method instead.

Didomi.off

The SDK provides the Didomi.off method to unsubscribe from events that were previously registered either through the didomiEventListeners array or using the Didomi.on method.

const callback = () => {
  console.log('Event triggered');
};

// Register via didomiEventListeners
window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'event.type',
  listener: callback
});


// Or register via Didomi.on
window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function () {
  Didomi.on('event.type', callback);
});

// Later, unsubscribe
Didomi.off('event.type', callback);

React

If you are using our React plugin, event listeners can be passed as props to the DidomiSDK component:

consentHasChanged() {
    // Do something when the consent from the user has changed
}

preferencesClickPurposeAgree(purposeId) {
    // Do something when user agrees on a purpose
}

...

<DidomiSDK
    ...
    onConsentChanged={this.consentHasChanged.bind(this)}
    onPreferencesClickPurposeAgree={this.preferencesClickPurposeAgree.bind(this)}
/>

Event types

This section presents a comprehensive list of the event types exposed by the Didomi SDK and usage examples.

api.error

Triggered when an error happens while sending an HTTP request to our API for collecting consents, events, metrics, etc.

Listener parameters

context object that contains the following properties:

Key

Description

reason

The reason for the request error.

Possible values: - request.failure when the request fails to be sent for any reason (timeout, no connection, blocked by an extension, etc.) - response.error when we received an error response from the server based on the HTTP response code (>= 400)

id

An ID identifying the request that failed. Possible values: - createEventPageview: HTTP request to collect an event after a page view

- createEventConsentAsked: HTTP request to collect an event after consent was asked

- createEventConsentGiven: HTTP request to collect an event after consent was given

- createEventUIAction: HTTP request to collect an event after a interaction with the UI

- createEventSyncAcknowledged: HTTP request to collect an event after sync is acknowledged

- getRemoteConsentUser: HTTP request to get the remote consent

- requestAuthentication: HTTP request to request authentication

- sendMessage: HTTP request to send a login message (remote consent flow)

- verifyOtpCode: HTTP request to send and verify an OTP verification code - createSignature: HTTP request to sign a Didomi Consent String - getSyncData: HTTP request to get user choices from the backend (sync)

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'api.error',
  listener: function ({ id, reason }) {
    // An API error happened
  }
});

consent.changed

Triggered when the user consent status changes either as the result of a user action or an API call.

Listener parameters

context object that contains the following properties:

Key

Description

action

The user action that triggered the consent change. Possible values: click (explicit click on the buttons), navigate (click to navigate to another page) or external (external call to setUserAgreeToAll)

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'consent.changed',
  listener: function (context) {
    // The user consent status has changed
  }
});
consentHasChanged() {
    // The user consent status has changed
}

...

<DidomiSDK
    ...
    onConsentChanged={this.consentHasChanged.bind(this)}
/>

consent.pendingchanged (Currently only used for preference center)

Triggered when a pending content is added or removed from the queue through the method Didomi.setPendingConsentForEntityById or cleared through Didomi.savePendingConsents.

Listener parameters

Key

Description

pendingConsents

The list of pending consents

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'consent.pendingchanged',
  listener: function ({ pendingConsents }) {
    // The number of pending consent has changed
  }
});

integrations.consentpassedtodfp

Listener parameters

The listener is provided with a single data object that has the following properties:

Property

Type

Description

consentStatus

boolean

Consent status of the user for the vendor Google.

true if the user has given consent.

false if the user has denied consent.

undefined if the user has not made a choice yet.

index

number

The index is the number of the event on the page. There is always a first event that gets triggered with index 0 on page load. More events can be triggered if the user changes their consent preferences on the page. The index gets incremented by 1 for every event triggered.

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'integrations.consentpassedtodfp',
  listener: function (data) {
    // Consent has been passed to Google
    // Load or refresh ads as needed with DFP, Prebid, etc.
    // `data.consentStatus` contains the current consent status of the user (true/false/undefined)
    // `data.index` contains the index of the event (integer)
    if (data.index === 0) {
      // This is the very first event on the page that gets triggered on page load
    } else {
      // This is an event that happens later on the page, after a user action (user giving consent or changing their preferences)
    }
  }
});

Not available in React yet.

notice.backdropclick

Only triggers when GDPR is active with a pop-in notice

Triggered when the user has clicked on the backdrop of a pop-in notice. This event only gets fired when a consent notice of type pop-in is displayed.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'notice.backdropclick',
  listener: function () {
    // Your event listener
  }
});
noticeBackdropClicked() {
    // The user has clicked on the backdrop
}

...

<DidomiSDK
    ...
    onNoticeBackdropclick={this.noticeBackdropClicked.bind(this)}
/>

notice.clickagree

Triggered when the user has clicked on the Agree and close button of a consent notice.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'notice.clickagree',
  listener: function () {
    // The user has clicked on the "Agree and close" button
  }
});
noticeAgreeClicked() {
    // The user has clicked on the "Agree and close" button
}

...

<DidomiSDK
    ...
    onNoticeClickAgree={this.noticeAgreeClicked.bind(this)}
/>

notice.clickclose

Triggered when the user has clicked on the Close icon of a consent notice with format Popup.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'notice.clickclose',
  listener: function () {
    // The user has clicked on the Close button
  }
});

notice.clickdisagree

Triggered when the user has clicked on the Decline button of a consent notice.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'notice.clickdisagree',
  listener: function () {
    // The user has clicked on the "Decline" button
  }
});

notice.clickmoreinfo

Does not trigger for CCPA

Triggered when the user has clicked on the More information link of a consent notice.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'notice.clickmoreinfo',
  listener: function () {
    // The user has clicked on the "More information" link
  }
});
noticeMoreInfoClicked() {
    // The user has clicked on the "More information" link
}

...

<DidomiSDK
    ...
    onNoticeClickMoreInfo={this.noticeMoreInfoClicked.bind(this)}
/>

notice.clickviewvendors

Does not trigger for CCPA

Triggered when the user has clicked on the View our partners link of a consent notice.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'notice.clickviewvendors',
  listener: function () {
    // The user has clicked on the "View our partners" link
  }
});
noticeViewVendorsClicked() {
    // The user has clicked on the "View our partners" link
}

...

<DidomiSDK
    ...
    onNoticeClickViewVendors={this.noticeViewVendorsClicked.bind(this)}
/>

notice.hidden

Triggered when the user closes the consent notice.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'notice.hidden',
  listener: function () {
    // The notice has been hidden
  }
});
noticeHidden() {
    // The notice has been hidden
}

...

<DidomiSDK
    ...
    onNoticeHidden={this.noticeHidden.bind(this)}
/>

notice.shown

Triggered when the consent notice gets shown to the user.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'notice.shown',
  listener: function () {
    // The notice has been shown
  }
});
noticeShown() {
    // The notice has been shown
}

...

<DidomiSDK
    ...
    onNoticeShown={this.noticeShown.bind(this)}
/>

preferences.clickagreetoall

Does not trigger for CCPA

Triggered when the user has clicked on the Agree to all button of the Preferences pop-in.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.clickagreetoall',
  listener: function () {
    // The user has clicked on the "Agree to all" button 
  }
});
preferencesAgreeToAllClicked() {
    // The user has clicked on the "Agree to all" button 
}

...

<DidomiSDK
    ...
    onPreferencesClickAgreeToAll={this.preferencesAgreeToAllClicked.bind(this)}
/>

preferences.clickclose

Triggered when the user has clicked on the Close icon of the Preferences pop-in.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.clickclose',
  listener: function () {
    // The user has clicked on the "Close" icon
  }
});

preferences.clickdisagreetoall

Does not trigger for CCPA

Triggered when the user has clicked on the Disagree to all button of the Preferences pop-in.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.clickdisagreetoall',
  listener: function () {
    // The user has clicked on the "Disagree to all" button
  }
});
preferencesDisagreeToAllClicked() {
    // The user has clicked on the "Disagree to all" button
}

...

<DidomiSDK
    ...
    onPreferencesClickDisagreeToAll={this.preferencesDisagreeToAllClicked.bind(this)}
/>

preferences.clickpurposeagree

Does not trigger for CCPA

Triggered when the user has enabled a specific purpose or category on the Preferences pop-in.

Listener parameters

The listener is provided with a single data object that has the following properties:

Property

Type

Description

purposeId

string

Unique ID of the purpose that was enabled

category

boolean

true if the purpose clicked was a category

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.clickpurposeagree',
  listener: function (data) {
    // The user has enabled a specific purpose
    // `data.purposeId` contains the ID of the purpose
    // `data.category` contains a boolean to identify if the purpose was category
  }
});
preferencesPurposeAgreeClicked(data) {
    // The user has enabled a specific purpose
    // `data.purposeId` contains the ID of the purpose
    // `data.category` contains a boolean to identify if the purpose was category
}

...

<DidomiSDK
    ...
    onPreferencesClickPurposeAgree={this.preferencesPurposeAgreeClicked.bind(this)}
/>

preferences.clickpurposedisagree

Does not trigger for CCPA

Triggered when the user has disabled a specific purpose or category on the Preferences pop-in.

Listener parameters

The listener is provided with a single data object that has the following properties:

Property

Type

Description

purposeId

string

Unique ID of the purpose that was disabled

category

boolean

true if the purpose clicked was a category

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.clickpurposedisagree',
  listener: function (data) {
    // The user has disabled a specific purpose
    // `data.purposeId` contains the ID of the purpose
    // `data.category` contains a boolean to identify if the purpose was category
  }
});
preferencesPurposeDisagreeClicked(data) {
    // The user has disabled a specific purpose
    // `data.purposeId` contains the ID of the purpose
    // `data.category` contains a boolean to identify if the purpose was category
}

...

<DidomiSDK
    ...
    onPreferencesClickPurposeDisagree={this.preferencesPurposeDisagreeClicked.bind(this)}
/>

preferences.clicksavechoices

Does not trigger for CCPA

Triggered when the user has clicked on the Save button on the Preferences pop-in (Purposes view).

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.clicksavechoices',
  listener: function () {
    // The user has clicked on the "Save" button
  }
});
preferencesSaveChoicesClicked() {
    // The user has clicked on the "Save" button
}

...

<DidomiSDK
    ...
    onPreferencesClickSaveChoices={this.preferencesSaveChoicesClicked.bind(this)}
/>

preferences.clickvendoragree

Does not trigger for CCPA

Triggered when the user has enabled a specific vendor on the Preferences pop-in.

Listener parameters

The listener is provided with a single data object that has the following properties:

Property

Type

Description

vendorId

string

Unique ID of the vendor that was enabled

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.clickvendoragree',
  listener: function (data) {
    // The user has enabled a specific vendor
    // `data.vendorId` contains the ID of the vendor
  }
});
preferencesVendorAgreeClicked(data) {
    // The user has enabled a specific vendor
    // `data.vendorId` contains the ID of the vendor
}

...

<DidomiSDK
    ...
    onPreferencesClickVendorAgree={this.preferencesVendorAgreeClicked.bind(this)}
/>

preferences.clickvendordisagree

Does not trigger for CCPA

Triggered when the user has disabled a specific vendor on the Preferences pop-in.

Listener parameters

The listener is provided with a single data object that has the following properties:

Property

Type

Description

vendorId

string

Unique ID of the vendor that was disabled

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.clickvendordisagree',
  listener: function (data) {
    // The user has disabled a specific vendor
    // `data.vendorId` contains the ID of the vendor
  }
});
preferencesVendorDisagreeClicked(data) {
    // The user has disabled a specific vendor
    // `data.vendorId` contains the ID of the vendor
}

...

<DidomiSDK
    ...
    onPreferencesClickVendorDisagree={this.preferencesVendorDisagreeClicked.bind(this)}
/>

preferences.clickvendorsavechoices

Does not trigger for CCPA

Triggered when the user has clicked on the Save button of the Preferences pop-in (Vendors view).

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.clickvendorsavechoices',
  listener: function () {
    // The user has clicked on the "Save" button
  }
});
preferencesVendorSaveChoicesClicked() {
    // The user has clicked on the "Save" button
}

...

<DidomiSDK
    ...
    onPreferencesClickVendorSaveChoices={this.preferencesVendorSaveChoicesClicked.bind(this)}
/>

preferences.clickviewvendors

Does not trigger for CCPA

Triggered when the user has clicked on the View vendors link of the Preferences pop-in to open the Vendors view.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.clickviewvendors',
  listener: function () {
    // The user has clicked on the "View vendors" link
  }
});

preferencesViewVendorsClicked() {
    // The user has clicked on the "View vendors" link
}

...

<DidomiSDK
    ...
    onPreferencesClickViewVendors={this.preferencesViewVendorsClicked.bind(this)}
/>

preferences.hidden

Triggered when the user closes the Preferences pop-in.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.hidden',
  listener: function () {
    // The Preferences pop-in has been hidden
  }
});

preferences.shown

Triggered when the Preferences pop-in gets shown to the user.

Listener parameters

None

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'preferences.shown',
  listener: function () {
    // The Preferences pop-in has been shown
  }
});

sync.ready

Triggered when the syncing process is done on the page and the SDK is ready.

This event is meant to be a replacement to window.didomiOnReady when you need to wait for the sync process to be complete and for the SDK to be ready on the page.

It is fired in every case:

  • When syncing is disabled

  • When syncing is enabled but not required (ie the user information is recent enough)

  • When syncing is enabled and has happened (including in error cases)

Listener parameters

SyncReadyEvent object

Property
Type
Description

statusApplied

boolean

Indicates if the user status has been applied locally from the remote Didomi backend. true if the user status was applied from the remote, false otherwise.

syncAcknowledged

Function

Callback that can be used to communicate to the Didomi servers that the synchronization has been communicated to the user. Returns true if the API event was successfully sent, false otherwise.

syncError

undefined | string

An error message if the sync failed

Example

window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
  event: 'sync.ready',
  listener: function () {
    // The SDK is ready and syncing is done
  }
});
PreviousDeprecatedNextPerformance

Last updated 1 month ago

Triggered when the user consent status has been passed to Google DFP / AdSense / AdExchange. This is only triggered when the is enabled on your website. Visit that section for more information.

Google DFP / AdSense / AdExchange integration