Skip to content

analytics setup

ConsentGatedAnalyticsProvider

AnalyticsProvider with consent wiring, taking the decision as booleans so this package never imports a consent library. The bus is rebuilt when refused flips, dropping what it held; listeners follow granted.

import { ConsentGatedAnalyticsProvider } from "@evolve-storefront/analytics/consent-gated";
PropTypeDescription
grantedboolean

Whether the shopper granted analytics consent.

refusedboolean

Whether they decided and said no, as opposed to not having decided yet.

listenersreadonly AnalyticsListener[]

The vendors to subscribe while granted. Resubscribed when their names change.

options?AnalyticsBusOptions

Read when the bus is built, which is on mount and when refused changes.

children?ReactNode

AnalyticsProvider

Publishes one bus to every feature below it.

import { AnalyticsProvider } from "@evolve-storefront/analytics/provider";
PropTypeDescription
busAnalyticsBus
children?ReactNode