CartLineData, CheckoutStartedData, and so on). A custom sink registered with useAnalyticsSink receives the same payloads and implements every event, as a no-op if it has no use for one.
analytics/analytics-provider
@replohq/sdk/analytics/analytics-provider
useAnalytics
Returns the AnalyticsSink from the nearest AnalyticsProvider. Throws if used outside of an AnalyticsProvider.
useAnalyticsOptional
Returns the AnalyticsSink if an AnalyticsProvider is present, or null otherwise. Does not throw — safe to use in components that may render with or without analytics.
useAnalyticsSink
Register one stable, consent-aware sink beneath ReploProvider.
analytics/analytics-sink
@replohq/sdk/analytics/analytics-sink
AnalyticsProductLine
One product line on a product, cart, collection or checkout event. Prices are decimal major units (19.99), never integer minor units.
AnalyticsSink
What useAnalytics() returns, and what every sink implements, including sinks registered with useAnalyticsSink. Each event takes its typed payload; a sink with no use for an event implements it as a no-op.
CartLineData
Sent by the cart provider for each added or removed line.
CartViewedData
Sent by the cart provider when the cart opens.
CheckoutStartedData
The cart a shopper takes to checkout, with its order total.
ClickData
A site-defined click; its properties are forwarded as-is.
CollectionViewedData
Sent by useCollectionViewedAnalytics.
LegacyCheckoutLineItem
A checkout line as older starter carts built it.
LegacyCheckoutStartedData
The nested checkout payload older starter carts send.
LegacyMoney
A money amount as older starter carts built it.
ProductViewedData
Sent by useProductViewedAnalytics.
PurchaseData
Order amounts are decimal major units, like PurchasePayload.amount.
Also exported
analytics/sinks/intelligems-sink
@replohq/sdk/analytics/sinks/intelligems-sink
IntelligemsEventMappings
Each mapping receives the event’s typed payload.
IntelligemsSink
Sends explicitly selected custom goals through the installed Intelligems SDK. Native page views, experiment assignment, and order attribution remain owned by useIgTrack and Shopify; duplicating them as custom events changes reports.
analytics/hooks/use-product-viewed-analytics
@replohq/sdk/analytics/hooks/use-product-viewed-analytics
useProductViewedAnalytics
Fires a productViewed analytics event when the product or selected variant changes. Deduplicates by product+variant ID so the same combination is only tracked once per component lifecycle.
analytics/hooks/use-collection-viewed-analytics
@replohq/sdk/analytics/hooks/use-collection-viewed-analytics
useCollectionViewedAnalytics
Fires a viewCollection analytics event carrying the collection’s products once the collection and its product list are both available. Re-renders and product-list updates for the same collection do not fire again; a different collection does, and returning to an earlier one counts as a new view, matching useProductViewedAnalytics.