use Analyticshook
A hook that provides access to the analytics provider context. Must be a descendent of Analytics.Provider
.
Anchor to returnsReturns
A function to tell you the current state of if the user can be tracked by analytics. Defaults to Customer Privacy API's .
The current cart state. You can overwrite the type by passing a generic
The custom data passed in from the .
The previous cart state. You can overwrite the type by passing a generic
A function to publish an analytics event.
A function to register with the analytics provider. It holds the first browser load events until all registered key has executed the supplied ready
function. See example register usage.
The shop configuration required to publish events to Shopify.
A function to subscribe to analytics events.
Example
Anchor to examplesExamples
Example usage with :
Anchor to example-useanalyticsregisteruseAnalytics.register
Registers a unique key with the analytics provider component, enabling custom analytics integrations to wait for a callback before sending event data.