What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Shopify Analytics Live View Sessions not working with Hydrogen

Solved

Shopify Analytics Live View Sessions not working with Hydrogen

ricomateria
Tourist
5 2 1

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.

Accepted Solution (1)

ricomateria
Tourist
5 2 1

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.

View solution in original post

Replies 3 (3)

ricomateria
Tourist
5 2 1

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.

ricomateria
Tourist
5 2 1

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.

david337
Tourist
9 1 1

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