The AMP Project has provided an attribute to block components unless the user has consented. To take advantage of this feature, add the data-block-on-consent attribute to the AMP component. In effect, this means that all behaviors of the element (e.g. sending analytics pings for <amp-analytics> or the loading of an <amp-ad>) are delayed until the relevant consent instance is accepted.
Individual components may override this behavior to provide more specialized handling. Please refer to each component's documentation for details. An example of a component using this attribute is below.