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

# Consent status for vendors

This page summarizes how vendors can access the consent state and the IAB consent string of the user in AMP.

## \<amp-ad> with RTC config

If you are a vendor that needs access to the consent state or the IAB consent string from an `amp-ad` tag with a RTC config, you can use macros: `CONSENT_STRING` and `CONSENT_STATE` to add those information to your requests URL.

* [List of vendors with RTC Config](https://github.com/ampproject/amphtml/blob/main/src/service/real-time-config/callout-vendors.js)
* [AMP Documentation related to the AMP Consent Integration](https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/rtc-documentation.md#amp-consent-integration)

## \<amp-ad> without RTC config

If you are a vendor that needs access to the consent state or the IAB consent string from an `amp-ad` tag without a RTC config, Didomi allows this feature **on page load** by sharing the values through the `sharedData` object.

You can access the data on the `window.context` object. For more information, please read [this section of the AMP documentation](https://github.com/ampproject/amphtml/tree/master/ads#amp-consent-integration).

Didomi is sharing 2 values through `window.context.consentSharedData`:

* `consentStateValue` which contains the consent state (a 0/1 value that indicates if the user has given consent to non-IAB purposes and vendors)
* `consentString` which contains the IAB consent string

{% hint style="danger" %}
The `consentSharedData` is only loaded once on page load.\
When the user gives consent for the first time, the consent string will only be available **on the next page load and will not trigger reloading the ads**.

We recommend using \<amp-ad> tags with RTC config when possible as those provide more dynamic control for vendors.
{% endhint %}

## \<amp-analytics>

If you are a vendor that needs access to the consent state or the IAB consent string from an `amp-analytics` tag, you can follow [this implementation by comScore](https://github.com/ampproject/amphtml/blob/master/extensions/amp-analytics/0.1/vendors/comscore.json).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.didomi.io/cmp/amp/consent-status-for-vendors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
