Shopify / hydrogen

Hydrogen lets you build faster headless storefronts in less time, on Shopify.
https://hydrogen.shop
MIT License
1.19k stars 241 forks source link

Analytics feedbacks #2025

Closed wizardlyhel closed 2 weeks ago

wizardlyhel commented 3 weeks ago

WHY are these changes introduced?

Introduce onReady callback for useCustomerPrivacy hook.

WHAT is this pull request doing?

HOW to test your changes?

Use analytics example:

  1. Test errors
    • Remove consent.checkoutDomain from root loader --> site should generate error about missing props
    • Remove consent.storefrontAccessToken from root loader --> site should generate error about missing props
  2. Test working analytics
    • Add consent.withPrivacybanner: false in the root loader --> You should see CustomAnalytics logging page views in the console log

Post-merge steps

Checklist

shopify[bot] commented 3 weeks ago
Oxygen deployed a preview of your hl-update-analytics-components branch. Details: Storefront Status Preview link Deployment details Last update (UTC)
vite ✅ Successful (Logs) Preview deployment Inspect deployment May 2, 2024 9:15 PM
third-party-queries-caching ✅ Successful (Logs) Preview deployment Inspect deployment May 2, 2024 9:15 PM
skeleton ✅ Successful (Logs) Preview deployment Inspect deployment May 2, 2024 9:15 PM
optimistic-cart-ui ✅ Successful (Logs) Preview deployment Inspect deployment May 2, 2024 9:15 PM
subscriptions ✅ Successful (Logs) Preview deployment Inspect deployment May 2, 2024 9:15 PM
custom-cart-method ✅ Successful (Logs) Preview deployment Inspect deployment May 2, 2024 9:15 PM

Learn more about Hydrogen's GitHub integration.

jamalsoueidan commented 3 weeks ago

Fixes #0000 👯

github-actions[bot] commented 3 weeks ago

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset. If the changes are user-facing and should cause a version bump, run npm run changeset add to track your changes and include them in the next release CHANGELOG. If you are making simple updates to examples or documentation, you do not need to add a changeset.