We are currently implementing hydrogen analytics in our frontend and I want to know if there is a way to test if specific events are being handled correctly.
The normal page_viewed event get’s processed correctly, we can check this in the stores analytics page.
But how can we check if the collection_viewed event is handled correctly or the prouct_viewed?
The most direct way to test these is through your browser’s developer tools. Open the Network tab, visit a product or collection page, and filter for monorail-edge.shopifysvc.com.
A 200 response means the analytics upload succeeded. A 207 indicates a payload issue; the response and development console should include the relevant error.
You can also temporarily subscribe to product_viewed and collection_viewed using Hydrogen’s useAnalytics() hook and log the payloads. That confirms the specific event is being published before it’s sent to Shopify.
If either event isn’t appearing, could you share the relevant Analytics.ProductView or Analytics.CollectionView setup and the network response status? That should help narrow down whether it’s the component payload, consent, or delivery.
Thank you for the answer, I have checked and I do get 200 responses back and the useAnalytics() does also fire at the right moments. But I want to know if the event is correctly categorized from Shopify in it’s backend.
For example the page_rendered event only get’s registered as such and correctly displayed in the analytics if it also contains the user_agent field but if I sent an event without it, I still get a 200 back and the event get’s quietly eaten in the shopify backend.
The advantage with page_rendered was that it basicaly maped 1:1 to an existing metric in the analytics. This is not the case for collection and product_viewed.
Thanks for clarifying, my previous reply was focused on whether the event was published and uploaded. Right now, there isn’t a developer-facing tool that confirms how an individual event was categorized or used downstream.
That said, could you share:
A sanitized request and response bodies for one product and collection event
Your Hydrogen version and whether you’re using the built-in Analytics provider
The storefront domain and approximate UTC test time
If you’d rather not share those details publicly no worries! Let me know and I can set up a DM. I can then see whether there’s anything further I’m able to confirm on our end, although I can’t guarantee we’ll be able to trace or verify individual events.