Skip to content
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

Adds region to Customer Privacy API #1832

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

rcaplanshopify
Copy link
Contributor

@rcaplanshopify rcaplanshopify commented Mar 18, 2024

Background

Adds region property to Customer Privacy API to allow partners to determine if/when to render more granular consent controls.

Monosnap Customer Privacy 2024-03-18 13-55-37

Solution

The update uses the getRegion method of the consent-tracking-api package to surface the region value from the _tracking_consent cookie.

The Customer Privacy API parses the string that contains country and province data (when available) and translates it into country and province code values for the new region object.

🎩

Docs

  • ...

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

Comment on lines +1801 to +1804
* @example `{countryCode: 'CA', provinceCode: 'ON'}` for a visitor in Ontario, Canada; `{countryCode: 'US', provinceCode: undefined}` for a visitor in the United States if geolocation fails to detect the state; or `undefined` if neither country nor province is detected or geolocation fails.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems strange that these don't render in the docs. Are the examples mean for IDE type signatures only?

I see the protected customer data information render for country and province code, but no examples for them, either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, @examples isn't supported yet. Only helpful for IDE.

@rcaplanshopify rcaplanshopify merged commit 0c54241 into unstable Mar 25, 2024
5 checks passed
@rcaplanshopify rcaplanshopify deleted the rc/add-region-to-customer-privacy branch March 25, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants