Repository navigation
feat(analytics)!: use Shopify's analytics from @shopify/hydrogen - #296
Open
rylanharper wants to merge 4 commits into
Open
rylanharper wants to merge 4 commits into
rylanharper wants to merge 4 commits into
Conversation
…rogen, add consent API route, require shopId Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ify's analytics bus Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nalytics bus Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…drogen requirement Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
❓ Type of change
📚 Description
@shopify/hydrogen@2026.10no longer re-exports the analytics helpers from@shopify/hydrogen-react. It ships Shopify's own scripts and a browser analytics bus instead. This moves the module to that API and drops@shopify/hydrogen-react. The components and composables keep their names.🛠️ Changes
window.Shopify.analytics). Cart changes use Shopify'strackCartAnalytics().subscribe()and theanalytics:publishhook read from the bus, so they also get cart events and page views.POST /api/:version/graphql.json, which Shopify's consent script calls. It forwards to the storefront proxy.headlesssales channel.srcis about 500 lines smaller).@shopify/hydrogen >=2026.10.0.@shopify/hydrogen-reactis dropped. CI matrix and docs updated.analytics.shopIdis required.autoPageView,domain,consent.checkoutDomain,consent.storefrontAccessToken,consent.banner.country,consent.banner.language. Addedcountry.storefrontIdno longer attributes events (the headless channel has none).subscribeand the hook receive Shopify's payload shapes, and only after consent allows tracking.ShopifyCustomViewandcustom_*events no longer work.setShopContext()is a no-op.🧪 Tests
pnpm check:packagepass.playground-v4: page, collection and add-to-cart events reach Shopify.🔜 Questions
ShopifyCustomView, now that it does nothing?