AMP Consent
Verifying AMP Consent
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
- We recommend running the test twice - once for 'decline', and once for 'accept'.
- 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:
- Load a mobile device with Google Chrome browser.
- In the vertical toolbar (left), click on Change Location and select a location in the EU.
- Use Google Chrome to browse to an AMP article. When prompted, accept/decline the consent message.
- Scroll down to a Taboola Ad.
- In the vertical toolbar (left), click on DevTools to open a DevTools window.
- Within the DevTools window, click on the
Select 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.
7. Within the DevTools window, select the Console tab.
8. Typewindow.context.getConsentState(console.log);
and pressEnter
.
9. 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.
Updated over 2 years ago