Analytics. Providercomponent
Provides a context for tracking page views and cart events to send as analytics data to Shopify. This component is integrated with the Customer Privacy API for consent management. The provider can also be used to connect third-party analytics services through its subscribe and publish system. The hook provides access to the analytics provider context.
You can also listen to a document
event for . It will be emitted when the Customer Privacy API is loaded.
Anchor to propsProps
The cart or cart promise to track for cart analytics. When there is a difference between the state of the cart, will trigger a
event. It will also produce
and
based on cart line quantity and cart line id changes.
The customer privacy consent configuration and options.
An optional function to set wether the user can be tracked. Defaults to Customer Privacy API's .
React children to render.
The domain scope of the cookie set with . *
An optional custom payload to pass to all events. e.g language/locale/currency.
Disable throwing errors when required props are missing.