analytics tracker for js and react

Downloads in past


1.1.214 days agoa year agoMinified + gzip package size for @wildberries/wb-front-analytics-tracker in KB



This package designed for wildberries analytics and contains:

- analyticsEventEmitter - sender function for analytics - withAnalytics - HOC for React components - SHAREDEVENTS - shared event constants

analyticsEventEmitter contains methods:

- init - method to initialize analyticsEventEmitter, params:
- prefix (string, non requred) - will be added to all events if in the events will be custom
- getIsInitialized - method to check if analyticsEventEmitter was initialized - sendEvent - method to send events, params:
- name (string, required) - event name
- params (any, required) - event params
- customEvent (boolean, required) - need to add prefix or not

withAnalytics injects method:

- sendAnalytics, params:
- name (string, required)
- params (any, required)
- customEvent (boolean, required)


export const SHARED_EVENTS = {
  PAGE_VIEW: 'pageview',
  PERFORMANCE: 'suppliers-portal-front-performance',