Analytics
Introduction
Anchor link to section titled "Introduction"Analytics is important in commerce to allow for measuring results and driving business decisions.
Hydrogen provides recommended patterns for collecting and transmitting site telemetry. These patterns work for first-party Shopify analytics, which enables you to collect and view metrics in the Shopify admin. This also enables you to send relevant data to third-party services such as Google Analytics and others.
Requirements
Anchor link to section titled "Requirements"- You've completed the Hydrogen Getting Started with a
Hello World
example project.
Setting up analytics instrumentation
Anchor link to section titled "Setting up analytics instrumentation"Learn how to set up analytics instrumentation and listen for events such as page view and add-to-cart.
Shopify recommends this analytics instrumenation pattern to collect data from multiple data sources and process the collected data in the same code area.
Sending analytics to Shopify
Anchor link to section titled "Sending analytics to Shopify"Learn how use Hydrogen components to send analytics to Shopify to power Shopify's analytics dashboards and Live View for your store.