hydrogen
hydrogen copied to clipboard
[BUG] Analytics - PAGE_VIEW event is published when updating server props without navigating
Describe the bug
When updating the server props and staying on the same route, the PAGE_VIEW event (and events added to publisheEventsOnNavigate) are being published.
To Reproduce
Clone and run this repo: https://github.com/nattyg93/shopify-hydrogen-analytics-bug
- Open the console
- Click the "Change server props" button
- Observe the VIEW_PAGE event is triggered each time the button is clicked
Expected behaviour The PAGE_VIEW should only trigger when navigating to a new page, rather than whenever server props are updated.
Additional context
- Hydrogen version: 0.22.1
- Node version: 0.16.4
This is still a problem in hydrogen 0.24.0.
Seems like we experience the same bug ;(