Product analytics
The API is @shared/analytics. React adapters are @shared/analytics-react.
- Import
trackandtrackPagefrom@shared/analyticsandTrack,TrackPage, andTrackScreenfrom@shared/analytics-react. - Do not re-export
track,trackPage,Track,TrackPageorTrackScreenfrom app modules. Appsegment.tsfiles only wire the host. - Register the Segment client, consent,
identify, extra props, and props filters in app (currently/apps/**/segment.ts). - Flow packages may keep an injected
trackhelper so tests can pass a fake. They must not import an app barrel. - In tests, mock
@shared/analytics(and@shared/analytics-reactwhen the component is under test). - Do not put PII in event payloads. See detect-data-leaks and client-ids.
Portfolio charts (@ledgerhq/wallet-analytics) are a different package. Consent models stay in their own READMEs; apps only wire them into setEnabledFn and updateIdentify.


