Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hello,
I followed the docs for setting up Shopify Page View analytics with Hydrogen about 10 times now. Cart analytics seem to work (when I add something to the cart, I see 1 Active Cart), but live visitor sessions do not show up. I'm also getting 200 responses from the request hitting .well-known/shopify/monorail/unstable/produce_batch.
Is there possibly another step I'm missing? I'm deployed to oxygen - I'm not using any third party hosting.
Solved! Go to the solution
This is an accepted solution.
Helen found the answer the issue - it was due to me using the STOREFRONT_ID instead of the Shop ID in the root.tsx loader for the analytics: {shopId: shopId} variable.
Note - the live view analytics work fine on the storefront url (the myshopify.com one). But, I cannot get this working for my production url.
This is an accepted solution.
Helen found the answer the issue - it was due to me using the STOREFRONT_ID instead of the Shop ID in the root.tsx loader for the analytics: {shopId: shopId} variable.
How did you pass this data? Are you able to give me a snippet of your code? I can only see storefront id on the server.ts, and shopId on the robots.txt.tsx. Thanks