HomeGuidesAPI ReferenceGraphQL
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Consent

How to update a customer's consent for receiving marketing communication in Optimizely Data Platform (ODP) using the Web SDK.

🚧

Important

Users who are opted-out cannot receive marketing messages from ODP on any channel.

Only transactional messages (for example, order receipt or, shipping notifications) will be received by these users.

Updating consent modifies a customer's ability to receive marketing communications.

Opt-In/Opt-out

FieldValue
consent (optional)Boolean; defaults to true
identifier_field_name (optional)defaults to 'email'
identifier_value (optional)string
update_reason (optional)string
update_ts (optional)timestamp; defaults to current time
event_data (optional)object holding additional event fields

Opt-In example

zaius.consent({
  consent: true,
  identifier_field_name: 'email',
  identifier_value: '[email protected]',
  update_reason: '',
  update_ts: 123456789,
  event_data: {}
  });

Events

ODP generates events automatically for the purposes of analytics and auditing. The events are structured as follows:

Event TypeEvent Action
consentopt-in
consentopt-out

Did this page help you?