---
updatedAt: 2026-08-10T09:56:40.000Z
---

# Active Cookie Consent Client-Side Implementation

For Experience API implementation, see the <Anchor target="_blank" href="doc:cookie-consent-api">API cookie consent guide</Anchor>

**Active cookie consent** enables your website to tell Dynamic Yield whether a user has consented to cookies, so Dynamic Yield can apply the correct data collection and personalization behavior.

This guide explains the client-side implementation for sites that use the Dynamic Yield script. Learn more about active consent in <Anchor target="_blank" href="https://support.dynamicyield.com/hc/en-us/articles/14274730414109-Dynamic-Yield-Privacy-Center">The Dynamic Yield Privacy Center</Anchor>.

***

## Set the user's consent status

Use `DY.userActiveConsent` to declare, update, and verify a user's consent status.&#x20;

```javascript
DY.userActiveConsent = { accepted: <true | false> };
```

* `true` – User has granted consent
* `false` – User has not granted consent, had denied consent, or consent status is unknown

Set the value to reflect the user's current consent status. If no valid consent signal exists, use `false`.&#x20;

You can set this property before the dynamic Yield script loads, and update it later whenever the user consent status changes.&#x20;

***

## Common implementation scenarios

* **Consent available at page load:&#x20;**&#x49;f your site already knows the user's consent status when the page loads, set the API to declare the status before the page loads.
* **Consent granted or withdrawn during the session:** A user can grant or deny consent at any juncture you provide on your site, such as a cookie management panel or consent popup.&#x20;
* **Consent verification:** At any time, you can check the value of `DY.userActiveConsent.accepted` to determine a user's consent status.

![](https://files.readme.io/d099e257e43b5b83d6ba58f926d852cca961f0cef0da05ab8ced08d0b8b089dc-Screenshot_2026-08-10_at_12.23.24.png)

***

## Verification and enablement

1. Implement the API on your site. It is ignored until active cookie consent is enabled.
2. In **Experience OS ›** **Settings › Data Privacy › Active Cookie Consent**, click **Preview** to experience the site as if active cookie consent is enabled.
3. After successful verification, contact Dynamic Yield Support to enable active cookie consent.