> ## Documentation Index
> Fetch the complete documentation index at: https://docs.immutable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Consent

> Set what Audience may collect about each player: nothing, anonymous activity, or activity with their identity.

Every player has a consent level, and it decides what Audience collects about them. You ask the player and set the level: the SDKs have no consent prompt of their own.

## The three levels

| Level | What's sent | Use it |
| - | - | - |
| `none` | Nothing. On the web, the SDK clears its cookies. | Before the player has chosen, or when they decline |
| `anonymous` | Activity without identity: page views, events, sessions and attribution | When the player accepts analytics but not marketing |
| `full` | Everything in `anonymous`, plus who the player is: `identify()` and hashed email addresses from forms | When the player accepts marketing and personalised ads |

Every SDK starts at `none`. Until you raise the level, nothing reaches Audience.

## Change a player's level

Call this when the player answers your prompt or changes their mind:

```ts theme={null}
// Web SDK
audience.setConsent('full');
```

```csharp theme={null}
// Unity SDK
ImmutableAudience.SetConsent(ConsentLevel.Full);
```

The change applies straight away. Lowering the level stops anything the new level doesn't allow. Events already sent keep the level they were sent under.

With the HTTP API, you apply the level yourself and record it with `PUT /v1/audience/tracking-consent`. See [Track with the HTTP API](https://docs.immutable.com/audience/track/http-api.md#consent).

## Browser privacy signals

If the player's browser sends a Global Privacy Control or Do Not Track signal, the Web SDK stays at `none`, whatever level you set.

## Read consent from your consent manager

The tracking pixel can read consent from your site's consent manager instead of you setting it. Set `consentMode` to `auto` and leave out `consent`:

```html theme={null}
<script>
(function(){
var w=window,i="__imtbl";
w[i]=w[i]||[];
w[i].push(["init",{"key":"YOUR_PUBLISHABLE_KEY","consentMode":"auto"}]);
var s=document.createElement("script");s.async=1;
s.src="https://cdn.immutable.com/pixel/v1/imtbl.js";
document.head.appendChild(s);
})();
</script>
```

The pixel starts at `none`, then reads Google Consent Mode v2 first and IAB TCF v2 second:

| Your consent manager says | The pixel sets |
| - | - |
| Google Consent Mode v2: `analytics_storage` granted | `anonymous` |
| Google Consent Mode v2: `analytics_storage` and `ad_storage` granted | `full` |
| IAB TCF v2: consent to purpose 1 | `anonymous` |
| IAB TCF v2: consent to purpose 1 and to purpose 3, 4 or 5 | `full` |
| Anything else | `none` |

The pixel keeps listening, so it follows the player when they change their cookie choices. If it finds no consent manager within about 2.5 seconds, it stays at `none`.

With the Web SDK, read your consent manager yourself and call `setConsent` with the matching level.

## Related

* [Track with the Web SDK](https://docs.immutable.com/audience/track/web-sdk.md)
* [Track with the Unity SDK](https://docs.immutable.com/audience/track/unity-sdk.md)
* [Track with the HTTP API](https://docs.immutable.com/audience/track/http-api.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.