Event tracking with Headless (Shopify Hydrogen)

This is for:

Developer

It’s crucial that you track touchpoints to analyze storefront performance, create reports, and power Coveo Machine Learning (Coveo ML) models. You can do this by sending events to the Coveo Usage Analytics (Coveo UA) service.

If you use Coveo Headless to build your product discovery solutions, track events using dedicated Headless controllers. These controllers automatically log specific commerce events, such as when a user makes a purchase or adds a product to a cart.

Headless commerce controllers rely on the Event Protocol to log events.

The following table shows the types of events to track and the corresponding controllers.

Event Tracking controller

Click

Use the InteractiveProduct controller to track clicks in product lists

Product view

Use the ProductView controller to log view events when a user navigates to a PDP

Cart

Use the Cart controller to update cart state when products are added or removed

Note

The Coveo app web pixel automatically logs purchase events for you. If you’re not using the app, implement your own web pixel.