-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve vendor facing doc to collect consent related information. #27855
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,16 +28,41 @@ getConsentPolicy() { | |
|
||
## Advanced blocking behaviors | ||
|
||
If the vendor wants to customize an AMP extension behaviors based on user control, use the `getConsentPolicyState` API. | ||
### On Consent State | ||
|
||
`getConsentPolicyState` returns a promise with one of the following values: | ||
AMP provides the consent state information for vendors to customize their behavior based on user control. | ||
|
||
The state has the following valid values. | ||
|
||
- `null` : no `<amp-consent>` is included | ||
- `CONSENT_POLICY_STATE.UNKNOWN` : The consent state is unknown | ||
- `CONSENT_POLICY_STATE.SUFFICIENT` : The consent is accepted | ||
- `CONSENT_POLICY_STATE.INSUFFICIENT` : The consent is rejected | ||
- `CONSENT_POLICY_STATE.UNKNOWN_NOT_REQUIRED` : The consent state is unknown, and `<amp-consent>` is informed to not prompt UI. | ||
|
||
In addition to the consent state, the vendor can also use the | ||
#### If you integrate with AMP as a first party AMP extension | ||
Use the `getConsentPolicyState` API. It returns a promise with one of the `CONSENT_POLICY_STATE` value. | ||
|
||
#### If you integrate with AMP as a third party ad vendor | ||
Access the value within the ad iframe using `window.context.initialConsentState`. Check [this](https://github.com/ampproject/amphtml/blob/master/ads/README.md#amp-consent-integration) for more details. | ||
|
||
#### If you integrate with AMP as an analytics vendor | ||
Get the value using `CONSENT_STATE` macro, or `${consentState}`. A request with the varaible will only be sent out after the state has resolved to one of the above state. | ||
|
||
### On Consent String ### | ||
|
||
AMP collects raw consent string value from `checkConsentHref` endpoint or from the CMP. The it passes the raw consent string to vendors without modification. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo here : |
||
It is then up to the vendor to intepret the string and customize behavior accordingly. AMP recommends handle the string on the server side. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: s/handle/handling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo here : |
||
|
||
AMP will always pass the local stored consent string if there's one. Update to the string will only be reflected the next page load. | ||
|
||
#### If you integrate with AMP as a first party AMP extension | ||
Use the `getConsentPolicyInfo` API. `getConsentPolicyInfo` returns a promise with the raw consent string value. | ||
|
||
Ways to get the consent string for ad/analytics vendors coming soon. | ||
|
||
### On Related Information | ||
|
||
In addition to the consent state and consent string, AMP extensions can also use the | ||
`getConsentPolicySharedData` API to receive additional consent related information about | ||
the user from the page owner. See [this](https://github.com/ampproject/amphtml/blob/master/extensions/amp-consent/amp-consent.md#response) for details about the `shareData`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here :
varaible