# 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).
