You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the new feature or change to an existing feature you'd like to see
I've been toying around with both and performance in general on our amp pages, and now that Core Web Vitals are a part of the Google Page Experience factor in google search, we have an added incentive to have the best performance possible.
In AMP consent, if I, as a user, reject tracking cookies, i have no need for loading https://cdn.ampproject.org/v0/amp-analytics-0.1.js, same goes if I've opted out of being having information shared, https://cdn.ampproject.org/v0/amp-form-0.1.js shouldn't be loaded, cause it isn't needed.
My suggestion would be to have the same data-block-on-consent attributes that we know from blocking amp components, able to block the import of the component scripts themselves, so that you can choose to only import the scripts you need, when you need them.
Describe alternatives you've considered
There is not really a way to block conditionally scripts at the moment as far as i know.
Thanks for considering this, everyone! When @SimonHogstromRonbol pointed out to me that pages would be slowed by loading scripts for components that were blocked, I encouraged him to create this issue. I hope it's technically feasible...
Thinking in terms of a simple single global consent, I wonder if there is an opportunity here for us to use the server to solve this, since with global consent there are only ever 3 consent states => Rejected (potentially only subset of elements/scripts are needed), Accepted (all elements/scripts needed), & No Decision Stored or Needed (all elements/scripts needed, potentially can be lazily loaded).
Not sure if this would work though since the consent decision is stored client side and so we would have to request different versions from the cache.
Describe the new feature or change to an existing feature you'd like to see
I've been toying around with both and performance in general on our amp pages, and now that Core Web Vitals are a part of the Google Page Experience factor in google search, we have an added incentive to have the best performance possible.
In AMP consent, if I, as a user, reject tracking cookies, i have no need for loading
https://cdn.ampproject.org/v0/amp-analytics-0.1.js
, same goes if I've opted out of being having information shared,https://cdn.ampproject.org/v0/amp-form-0.1.js
shouldn't be loaded, cause it isn't needed.My suggestion would be to have the same
data-block-on-consent
attributes that we know from blocking amp components, able to block the import of the component scripts themselves, so that you can choose to only import the scripts you need, when you need them.Describe alternatives you've considered
There is not really a way to block conditionally scripts at the moment as far as i know.
Additional context
@morsssss
The text was updated successfully, but these errors were encountered: