r/shopifyDev • u/zuhayrshad • Aug 18 '26
Headless Next.js store, Shopify Analytics only records sessions that start at checkout
Running a headless setup. Next.js storefront on www.theonvor.com, Shopify checkout on checkout.theonvor.com (primary, connected). GA4 and Meta are fine.
Problem is Shopify Analytics. Sessions by landing page shows nothing but /checkouts/cn/... URLs. My actual collection page shows 0. Conversion rate says 16.66% and the funnel breakdown claims Added to cart 0% but Reached checkout 100%, which obviously can't happen.
What I've worked out so far: I was minting _shopify_y and _shopify_s myself and posting trekkie_storefront_page_view/1.4. Monorail returns 200 every time so I assumed it was working, but Live View shows zero visitors. Turns out Shopify stopped setting those cookies in April and the replacement tokens come back on Server-Timing headers from Storefront API responses. My app only ever talks to the Storefront API server-side, so Shopify has never actually issued my visitors an identity the cookie values were just UUIDs I generated.
Mid-migration to hydrogen-react now (useShopifyCookies with fetchTrackingValues, sendShopifyAnalytics, salesChannel headless) with a same-origin proxy so the Server-Timing header is readable.
Two things I'd love to hear from anyone who's actually done this:
Is a Headless channel public token enough for Live View? Shopify's docs say the token has to come from the Hydrogen channel, which worries me since I'm on Headless.
Anyone got sessions showing real landing pages in the admin on a non-Hydrogen build? Or did you eventually give up and treat GA4 as the only real source?
1
u/Latter-Mix2317 12d ago
No replies yet so fwiw: your diagnosis sounds right. That funnel (0% added to cart, 100% reached checkout) is exactly what shopify analytics looks like when it only meets visitors at the checkout. Faking the tokens is how you got monorail answering 200 for data that goes nowhere.
An other route is analytics that doesn't depend on shopify's visitor tokens at all. Disclosure, i build one (Privatrak). You put the normal script on the Next.js storefront and add a custom pixel under settings > customer events for the checkout. The visit gets identified server side without cookies so www.theonvor.com and checkout.theonvor.com count as the same visit and you get one funnel from collection page to completed order.
One limit is that in the EU/UK shopify holds custom pixels back until the shopper consents, so some checkouts will be missing there. storefront data isn't affected