data-block-on-consent attribute is a pre-defined optional configuration that your organization can use to ensure that all behaviors of a component (e.g. sending analytics pings for
<amp-analytics> or the loading of an
<amp-ad>) are blocked until the desired action is completed.
Note: More information on blocking options can be found on the official AMP documentation page, click here. Additionally, be aware that Sourcepoint currently does not support the granular consent attribute
data-block-on-consent blocking behaviors
data-block-on-consent attribute is added to an AMP component to block a element behavior until the relevant action is accepted. Individual components may override this behavior to provide more specialized handling.
The data-block-on-consent attribute accepts the following behaviors:
The default blocking behavior for the attribute. The configured component is blocked until the end-user accepts all purposes and vendors on a property.
Note: The component will remain blocked if only granular consent is given for a subset of purposes and/or vendors on a property.
The configured component is blocked until the end-user responds to the consent message. End-user responses that would unblock the component include:
||The configured component will reject the consent automatically if consent is required but unknown. The reject consent decision will not be stored.|
In this section, we will review the behaviors of
_till_responded for the
data-block-on-consent attribute. In order to better illustrate each blocking behavior we will be adding the attribute to an
/* blocking component until end-user accepts all vendors and purposes */ <amp-img data-block-on-consent="_till_accepted" alt="avatar" src="https://www.w3schools.com/w3images/avatar_hat.jpg" width="500" height="333" layout="responsive" > </amp-img>
/* blocking component until end-user interacts with consent message */ <amp-img data-block-on-consent="_till_responded" alt="avatar" src="https://www.w3schools.com/w3images/avatar_hat.jpg" width="500" height="333" layout="responsive" > </amp-img>