Skip to main content

shopify:collection:view

Fires when a buyer opens a collection page.

You can use this to know which collection a buyer is browsing, and how many products are in it. The product count comes with the event, so you can tell a full collection from an empty one without a follow-up request.

A view-event custom element dispatches it, so a storefront wires it up in Liquid rather than in JavaScript. See dispatching view events.

Built-in collections with no collection record behind them, such as the all-products collection, have a null id. Their handle is still set.

Anchor to collection
collection
required

The collection the buyer landed on.

Anchor to detail
detail
Record<string, unknown>

Optional custom data for the storefront's internal use. Listeners can read it.


Was this page helpful?