The 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-purposes.

data-block-on-consent blocking behaviors

The 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:

Behavior Description

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:

  • Accepting all purposes and vendors
  • Rejecting all purposes and vendors
  • Granular consents for a subset of purposes and/or vendors
  • Dismissing the consent message
_auto_reject The configured component will reject the consent automatically if consent is required but unknown. The reject consent decision will not be stored.

data-block-on-consent examples

In this section, we will review the behaviors of _till_accepted and _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 <amp-img> component. 

_till_accepted _till_responded
/* blocking component until end-user accepts all vendors and purposes */


Was this article helpful?
0 out of 0 found this helpful



Article is closed for comments.