AMP Consent

Verification

Use the steps provided below to verify that consent signals are being passed correctly.

🚧

Failure to implement AMP consent correctly can result in a significant loss of revenue.


AMP does not support IAB TCF JavaScript API. Instead, it uses the <amp-consent> component.

πŸ“˜

Guidelines

  1. We recommend running the test twice - once for 'decline', and once for 'accept'.
  2. Use a browser testing tool like BrowserStack to specify a location in the EU.

The instructions below presume BrowserStack. Similar steps can be performed using a VPN.

Open BrowserStack and perform the following steps:

  1. Load a mobile device with Google Chrome browser.
  2. In the vertical toolbar (left), click on Change Location and select a location in the EU.
  1. Use Google Chrome to browse to an AMP article. When prompted, accept/decline the consent message.
  2. Scroll down to a Taboola Ad.
  3. In the vertical toolbar (left), click on DevTools to open a DevTools window.
  4. Within the DevTools window, click on theSelect Element tool (top, left) - and then click on the above Taboola Ad.

This sets the current context to the <iframe> that contains the Taboola content.
Make sure to tap the mouse lightly, so that you only select the element, without navigating away to the target URL.

  1. Within the DevTools window, select the Console tab.
  2. Type window.context.getConsentState(console.log); and press Enter.
  3. Check that the correct value is returned:

Console output

Status

{consentState: 1}

User provided consent

{consentState: 2}

User declined consent

{consentState: 3}

Unknown

Troubleshooting

Issue: Taboola content no longer displays

Problem

Once the user declines consent, Taboola content no longer displays.

Solution

Add data-block-on-consent='_till_responded' to each <amp-embed> tag.

<amp-embed width=100 height=100
  data-block-on-consent='_till_responded'
  type='taboola'
  ...
  data-url=''>
</amp-embed>

This ensures that Taboola can still display contextual content, even after the user declines consent (based on factors that are not user-specific).

πŸ“˜

For more information about amp-consent, refer to the AMP documentation.

Issue: Consent message does not display

Problem

AMP articles do not bring up a consent message.

Solution

Make sure that amp-consent has been implemented for all your AMP articles.