These APIs enable you to send user consent preferences to Dynamic Yield. To learn more about these APIs, see Visitor Data Privacy Management (GDPR Support).
Assumed Consent APIs
Consent to Data Collection
User data is collected and they are served personalized experiences unless they request to be opted out. There are two ways to use this method, depending on whether you are using a consent management tool or not (details below). For more details, see Assumed Consent Method of Data Privacy Management.
User Consents:
DY.API('consent_optin');
User Does Not Consent:
DY.API('consent_optout');
Active Cookie Consent APIs
Users are not served personalized experiences by default unless they actively provide consent. For more details, see Active Cookie Consent Method of Data Privacy Management.
User Consents:
DY.userActiveConsent = { accepted: true }
User Does Not Consent:
DY.userActiveConsent = { accepted: false}
Custom Analytics Platform Integration User Consent APIs
To enable custom integrations to respect user's data privacy settings, use one of the following APIs to make sure you do not serve content to opted-out users.
Promise Method
Returns a Promise that is only resolved when the current user is opted-in. Use this code inside the custom integration definition to prevent sending data to a third party unless the promise is resolved.
Syntax:
DYO.ActiveConsent.runWithActiveConsent()
Parameter Method
Embed your function in a parameter that is only run when the current user is opted-in. Use this code inside the custom integration definition to prevent sending data to a third party.
Syntax:
DYO.Consent.runWithConsent(action)
Parameter
- action: The function you want to run.