Customer PrivacyAPI
The API for interacting with a customer's privacy consent. It is similar to the Customer Privacy API in storefront.
Anchor to standardapiStandardApi
The base API object provided to purchase
extension targets.
Allows setting and updating customer privacy consent settings and tracking consent metafields.
Requires the capability to be set to
true
.
Requires access to protected customer data.
Customer privacy consent settings and a flag denoting if consent has previously been collected.
Anchor to useCustomerPrivacyuse Customer Privacy()
Returns the current customer privacy settings and metadata and re-renders your component if the customer privacy settings change.
CustomerPrivacy
An object containing flags for each consent property denoting whether they can be processed based on visitor consent, merchant configuration, and user location.
Stored tracking consent metafield data.
Whether the visitor is in a region requiring data sale opt-outs.
Whether a consent banner should be displayed by default when the page loads. Use this as the initial open/expanded state of the consent banner.
This is determined by the visitor's current privacy consent, the shop's region visibility configuration settings, and the region in which the visitor is located.
An object containing the customer's current privacy consent settings. *
Details about the visitor's current location for use in evaluating if more granular consent controls should render.
Read Customer Privacy
Anchor to examplesExamples
Anchor to example-use-a-sheet-to-manage-customer-privacy-consentUse a Sheet to manage customer privacy consent
You can apply changes to customer consent by using the API.
Requires the capability to be set to
true
.