---
title: Consent
slug: data-platform/docs/websdk-consent
docTags: 
createdAt: 2026-08-10T12:05:19.000Z
---

Updating [consent](docId\:A07DwLRZNbBJnXTusyMri) modifies a customer's ability to receive marketing communications.

:::hint{type="warning"}
**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.
:::

## Opt-in or opt-out

| Field                                  | Value                                                                                              |
| -------------------------------------- | -------------------------------------------------------------------------------------------------- |
| consent (optional)                     | Boolean; defaults to \`true\`                                                                      |
| identifier\\\_field\\\_name (optional) | String; defaults to \`email\`                                                                      |
| identifier\\\_value (required)         | String                                                                                             |
| update\\\_reason (optional)            | String; defaults to \`Global subscribe\` or \`Global unsubscribe\`\ depending on the consent value |
| update\\\_ts (optional)                | Timestamp; defaults to the current time                                                            |
| event\\\_data (optional)               | Object holding additional event fields                                                             |

## Consent example

Call the `consent()` method to opt-in and opt-out a customer.

:::hint{type="info"}
**Note**
`consent` defaults to `true` if you do not manually set the `consent` field.
:::

```javascript
zaius.consent({
  consent: true,
  identifier_field_name: 'email',
  identifier_value: 'tyler@zaius.com',
  update_reason: '',
  update_ts: 123456789,
  event_data: {}
  });
```

```javascript
zaius.consent({
  consent: false,
  identifier_field_name: 'email',
  identifier_value: 'tyler@zaius.com',
  update_reason: '',
  update_ts: 123474189,
  event_data: {}
  });
```

## Events

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

| Event Type | Event Action |
| ---------- | ------------ |
| consent    | opt-in       |
| consent    | opt-out      |
