# Load only after consent (positive or negative)

In this scenario, tags are loaded only after consent (positive or negative). If the user consent status is available because the user has already given consent through the CMP, the user consent status is passed to the tag. If the user consent status is not available yet (the CMP is still displayed), the tag is loaded only after consent regardless of the status.

Tags and vendors are split into four categories:

* [Vendors that block the tag by default](#vendors-that-block-the-tag-by-default)
* [amp-ad with a RTC config](#amp-ad-with-a-rtc-config)
* [amp-ad without a RTC config](#amp-ad-without-a-rtc-config)
* [Other tags/vendors](#other-tags)

{% hint style="info" %}
The behavior may vary depending on the type of tags and vendors. Please contact your vendors if the behavior you are looking for is not the one currently applied.
{% endhint %}

## Vendors that block the tag by default

You have nothing to add on your side. The current consent state will be sent automatically on each request.

```markup
<amp-analytics type="comscore">
  <script type="application/json">{ "vars": { "c2": "1234"}} </script>
</amp-analytics>
```

### Vendors

There is no clear list of vendors that automatically collect the user consent status from AMP. They can usually be identified through their AMP configuration by checking if they reference the `consentState` parameter.

List of vendors and their configurations:

* [Analytics](https://github.com/ampproject/amphtml/tree/master/extensions/amp-analytics/0.1/vendors)

## `amp-ad` with a RTC config

If you want to send the bid request regardless of the consent state, you can add a `sendRegardlessOfConsentState` in the RTC config JSON object and set it to `true`. Even if the consent is `rejected` or `dismissed`, a call will be made to the vendor. It is particularly useful when the vendor support the IAB consent string. For more information related to the support of the IAB consent string, please contact your vendors.

{% hint style="info" %}
To see if the vendor is able to receive the consent state or the consent string, you can take a look at [this list](https://github.com/ampproject/amphtml/blob/main/src/service/real-time-config/callout-vendors.js) and see if the macros CONSENT\_STATE or CONSENT\_STRING are available in their configuration.
{% endhint %}

Example of `amp-ad` with the type `DoubleClick` and a RTC Config with `APS`.

```markup
<amp-ad 
  data-block-on-consent
  width="300"
  height="200"
  type="doubleclick"
  data-slot="/1234"
  rtc-config='{
    "vendors": {
        "aps": {
          "sendRegardlessOfConsentState": true
        }
      }
    }'>
  </amp-ad>
```

### Send RTC call regardless of consent state

This option allows you to send the bid requests of the vendors present in the RTC configuration regardless of the consent state (accept/reject/dismiss). By default, the bid request is only sent if the user accept the consent.

You can find more information on the [AMP documentation](https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/rtc-documentation.md#amp-consent-integration).

### Summary

| Case               | RTC Call | Consent State | Consent String | Ad                                                                                                                                                                                                             |
| ------------------ | -------- | ------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Page load          | Not sent | Not available | Not available  | Not displayed                                                                                                                                                                                                  |
| Dismiss the banner | Sent     | Unknown       | Not available  | <p>Not displayed</p><p>With use of <a href="https://github.com/ampproject/amphtml/blob/master/extensions/amp-ad-network-doubleclick-impl/amp-consent.md">data-npa-on-unknown-consent</a>: Non-personalized</p> |
| Accept consent     | Sent     | Accepted      | Available      | Personalized                                                                                                                                                                                                   |
| Reject consent     | Sent     | Rejected      | Available      | Non-personalized                                                                                                                                                                                               |

More information about the [`amp-ad` with RTC configuration](https://gitlab.com/didomi/developers-documentation/-/blob/main/docs/cmp/amp/blocking-behaviors/broken-reference/README.md).

## `amp-ad` without a RTC config

If you want to unblock an `amp-ad` when a consent (positive/negative) is given, you can add the `_till_responded` value to the `data-block-on-consent` attribute.

```markup
<amp-ad
  data-block-on-consent="_till_responded"
  width="300"
  height="250"
  type="a9"
  ...
  >
</amp-ad>
```

More information about the [`amp-ad` without RTC configuration](https://gitlab.com/didomi/developers-documentation/-/blob/main/docs/cmp/amp/blocking-behaviors/broken-reference/README.md).

### Summary

#### Vendors supporting non-personalized ads

| Case               | Ad                                                                                                                                                                                                          |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Page load          | Not displayed                                                                                                                                                                                               |
| Dismiss the banner | <p>Not displayed<br>With use of <a href="https://github.com/ampproject/amphtml/blob/master/extensions/amp-ad-network-doubleclick-impl/amp-consent.md">data-npa-on-unknown-consent</a>: Non-personalized</p> |
| Accept consent     | Personalized                                                                                                                                                                                                |
| Reject consent     | Non-personalized                                                                                                                                                                                            |

#### Vendors not supporting non-personalized ads

| Case               | Ad            |
| ------------------ | ------------- |
| Page load          | Not displayed |
| Dismiss the banner | Personalized  |
| Accept consent     | Personalized  |
| Reject consent     | Personalized  |

## Other tags/vendors

If you want to unblock any other tags supporting the `data-block-on-consent` attribute when a consent (positive/negative) is given, you can add the `_till_responded` value to the `data-block-on-consent` attribute.

```markup
<amp-analytics
  data-block-on-consent="_till_responded"
  type="gtag"
  data-credentials="include"
>
  <script type="application/json">
    {
      "vars": {
        "gtag_id": "1234",
        ...
      },
      "triggers": {
        ...
      }
    }
  </script>
</amp-analytics>
```

### **Summary**

| Configuration                                  | When is the tag loaded                                        |
| ---------------------------------------------- | ------------------------------------------------------------- |
| Default (no `data-block-on-consent`)           | Tag is loaded on page load.                                   |
| With `data-block-on-consent="_till_responded"` | Tag is loaded once a consent (positive or negative) is given. |
