question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Introduce an easy way to block components by amp-consent

See original GitHub issue

This 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.

@jasti @lannka @torch2424

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
jasticommented, Jan 10, 2019

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.

0reactions
zhouyxcommented, Jan 11, 2019

Great! Thank you @honeybadgerdontcare. I’ll try that.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found