-
Notifications
You must be signed in to change notification settings - Fork 276
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
Add localization support for privacy banner + useCustomerPrivacy updates #2457
Conversation
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
This comment has been minimized.
This comment has been minimized.
/snapit |
🫰✨ Thanks @juanpprieto! Your snapshots have been published to npm. Test the snapshots by updating your "@shopify/cli-hydrogen": "0.0.0-snapshot-20240903172745",
"@shopify/hydrogen": "0.0.0-snapshot-20240903172745",
"@shopify/mini-oxygen": "0.0.0-snapshot-20240903172745",
"@shopify/remix-oxygen": "0.0.0-snapshot-20240903172745"
|
/snapit |
🫰✨ Thanks @juanpprieto! Your snapshots have been published to npm. Test the snapshots by updating your "@shopify/cli-hydrogen": "0.0.0-snapshot-20240903233028",
"@shopify/hydrogen": "0.0.0-snapshot-20240903233028",
"@shopify/mini-oxygen": "0.0.0-snapshot-20240903233028",
"@shopify/remix-oxygen": "0.0.0-snapshot-20240903233028"
|
analytics.mp4
Included on this PR:
1. Adds consent banner localization support to the
AnalyticsProvider
anduseCustomerPrivacy
To enable it simply pass
country
andlanguage
to theconsent
config returned from the loader2. Reworks the previously fragile customerPrivacy and privacyBanner
onReady
logic removing a not ideal 3s setTimeout and relying on Object.defineProperty on thewindow
instead to detect when these SDKs are actually available.Banner will show when ready instead of after 3 secs.
3. Deprecates a
getCustomerPrivacy
utilityNow that we have
privacyBanner
andcustomerPrivacy
returned from bothuseAnalytics
anduseCustomerPrivacy
we don't needgetCustomerPrivacy
4. Adds
privacyBanner
andcustomerPrivacy
to theuseAnalytics
anduseCustomerPrivacy
returns, so users can now use any of these SDK methods programmaticallyUsed in the demo videos header buttons.
5. Fixed an issue where tracking was temporarily allowed for a few milliseconds while the consent check was being performed by the customerPrivacy SDK
Tophat instructions:
privacyBanner
(showBanner, showPreferences) andcustomerPrivacy
(analyticsProcessingAllowed, setTrackingConsent) returned byuseAnalytics
and/oruseCustomerPrivacy
TODO
useCustomerPrivacy