> For the complete documentation index, see [llms.txt](https://docs.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.didomi.io/consent-management-platform-cmp/introduction/cmp-behavior-for-granular-consent.md).

# CMP behavior for granular consent

Granular consent refers to the individual selections an end-user may make on one or more purposes and/or vendors in your consent notice as opposed to a single action granting or denying consent for all purposes and vendors (i.e. Accept all or Refuse all). &#x20;

<figure><img src="/files/Bjd4T7F0yuSm9hoDZlRt" alt="" width="375"><figcaption></figcaption></figure>

In this article, we will cover how the Didomi CMP behaves in regards to granular consent for the following scenarios:

* [Conditioned custom vendor tags](#conditioned-custom-vendor-tags)
* [Agree/Disagree all](#agree-disagree-all)
* [Granular consent on purposes and no choice on vendors](#granular-consent-on-purposes-and-no-choice-on-vendors)

***

### Conditioned custom vendor tags

Conditioned custom vendor tags refers to the methods your organization utilizes to control how and when custom vendors and/or SDKs are triggered for your web/mobile property in regards to end-user consent.&#x20;

<table><thead><tr><th width="264"></th><th>Description</th></tr></thead><tbody><tr><td>Custom Didomi <code>&#x3C;script></code> tags</td><td><p>Used to conditionally load JavaScript tags or other HTML elements on your page. These custom <code>&#x3C;script></code> tags are commonly used for custom vendor tags on your webpage to control when a custom vendor can trigger based on meeting required conditions. </p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><a href="https://developers.didomi.io/cmp/web-sdk/third-parties/no-tag-manager#consent-to-vendors">Click here</a> for more information on the custom Didomi <code>&#x3C;script></code> tags.</p></div></td></tr><tr><td>Tag manager</td><td><p>Tag managers provide a centralized platform that allows marketers and developers to deploy, manage, and update vendor scripts and analytics tags on a website without directly modifying the site's source code.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><a href="https://developers.didomi.io/cmp/web-sdk/third-parties/tags-management/tag-managers">Click here</a> for more information on tag managers.</p></div></td></tr><tr><td>Third-party SDKs</td><td>Your organization can condition custom vendor tags on your mobile app via the Didomi API. <a href="https://developers.didomi.io/cmp/mobile-sdk/third-party-sdks">Click here</a> for more information.</td></tr></tbody></table>

Custom vendor tags can be conditioned on consent to the vendor and/or consent to specific purposes.&#x20;

{% hint style="info" %}
Didomi strongly recommends conditioning your custom vendor tags based on **end-user consent to the vendor** as we feel it is is the best way for your organization to respect end-user consent choices.&#x20;
{% endhint %}

{% tabs %}
{% tab title="Recommended: Conditioned for vendor consent" %}
When conditioning a custom vendor tag based on end-user consent to the vendor the native behavior for Didomi is to check end-user consent values for the vendor first and then consent on the purposes associated with it.&#x20;

If one or more purposes for the vendor associated has not been consented to by the end-user (i.e. purpose set to `false`) then the vendor will also be set to `false`.
{% endtab %}

{% tab title="Conditioned for purpose consent" %}
If your organization decides to condition custom vendor tags based on end-user consent for specific purposes please be advised that you assume the risk of not respecting end-user consent choices. The issues arise when there is a discrepancy between the end-user's consent for the specified purposes in the condition and their consent for the vendor.

Refer to the diagram below for more information:

<figure><img src="/files/p2Cq8iA6jtomKTkdBRA1" alt="" width="563"><figcaption></figcaption></figure>

When conditioning the custom vendor tag based on end-user consent for specific purposes [Schema 3](#schema-3) and [Schema 4](#schema-4) will result in behavior that does not reflect the end-user's selections.

#### Schema 3

In this scenario, the end-user has not provided consent to the specific purpose used in your condition but has granted consent to the vendor. In this case, Didomi will set the consent status for the vendor status to `false` since at least one of the purposes specified in the condition did not have consent and the custom vendor tag will not trigger.

#### Schema 4

In this scenario, the end-user has consented to all purposes specified in the condition but has also denied consent for the vendor. In this case, Didomi will set the vendor status to `false` however, since the purpose conditions were met the custom vendor tag would still trigger.
{% endtab %}
{% endtabs %}

### Agree/Disagree all

{% hint style="info" %}
This behavior is supported for the Web SDK and for APP SDK versions later than 2.7.0 on [Android ](https://developers.didomi.io/cmp/mobile-sdk/android/versions#id-2.7.0-june-6-2024)and 2.8.0 on [iOS](https://developers.didomi.io/cmp/mobile-sdk/ios/versions#id-2.8.0-june-6-2024).
{% endhint %}

Agree all and Disagree all are one-click buttons that will automatically accept or reject all purposes and vendors associated with a consent notice, respectively. If an end-user makes granular selections on purposes and/or vendors and then subsequently selects either the Agree all or Disagree all button, Didomi will give precedence to the Agree all or Disagree all action.

<figure><img src="/files/sdnTLpujXV2qEs8Rgqzp" alt="" width="563"><figcaption></figcaption></figure>

### Granular consent on purposes and no choice on vendors

When an end-user makes granular choices on purposes but does not make any choice on vendors, Didomi will only enable vendors that have at least one purpose enabled.

<figure><img src="/files/DQBrtQ7NOUvznjvwuBeA" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.didomi.io/consent-management-platform-cmp/introduction/cmp-behavior-for-granular-consent.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
