Introduce an easy way to block components by amp-consent
See original GitHub issueThis is part of the amp-consent-v2 work. We need a feature to block all amp-ad components on the page in an easy way. So that CMP can manage all ads on the page.
Approach 1: Block all <amp-ad>
components on the page if there’s <amp-consent type='cmp_name'>
on the page.
- Pro: Requires minimal work for the publisher if they use CMP to manage consent
- Con: Introduces extra delay to every
<amp-ad>
(even if the ad decides not to be blocked by CMP) because the<amp-ad>
will need to wait for the#buildCallback
of<amp-consent>
element.
Approach 2: Introduce a new meta tag that’s defined by the publisher. Block corresponding components on the page if the meta tag is found.
- Pro: Better performance because all information is in the header. Cleaner code because everything is synchronous.
- Con: Need the publisher’s effort to add meta tag to the header. If the publisher fail to add the meta tag, it will lead to cmp not blocking anything. (It could also be a pro if the CMP does not exist, because the publisher don’t need to individually tag every element they want to block)
After a discussion with @lannka, we decided Approach is more preferable. Please let us know if there’s any early feedback. I’ll post the detail design of the meta tag to the issue later.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:9 (9 by maintainers)
Top Results From Across the Web
amp-consent - Documentation
AMP provides a list of pre-defined consent policy instances for publishers to easily define consent blocking behaviors to individual components. Set the value ......
Read more >Ads personalization settings in Google's publisher ad tags
Use the disableInitialLoad() function to prevent the tag from sending ad ... of an amp-consent component, and the attributes data-block-on-consent and ...
Read more >2. Implement GDPR for AMP
Download the GDPR for AMP script from the admin section in the configuration. Block Content When Privacy Manager is Shown. By default the...
Read more >How to block an amp-components until other ...
I want to block some amp-components (amp-image, amp-ad, or amp-iframe) until one of the amp components is resolved. ie.
Read more >AMP website cookie consent and further tuning - Csaba Toth
Sicne this is such a common scenario I thought it'll be a simple task. Unfortunately it was utterly painful. The amp-consent component is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Based on the AMP principle: the user experience > developer experience > work we have to do. This seems to fall under the user experience bucket because we want to load the ads as quickly as possible without waiting for build callback. Option 2 SGTM.
Great! Thank you @honeybadgerdontcare. I’ll try that.