AnalyticsBrowser.load(settings, options?)
Initialize the analytics instance. Settings| Key | Type | Required | Description |
|---|---|---|---|
writeKey | string | Yes | Your Zixflow write key |
cdnURL | string | No | Override CDN base URL |
cdnSettings | object | No | Skip remote settings fetch |
plugins | Plugin[] | No | Plugins to register at load |
timeout | number | No | Dispatch timeout (default 300) |
AnalyticsBrowser (buffered instance that resolves to Analytics)
analytics.identify(userId?, traits?, options?, callback?)
Identify a user. ReturnsPromise<Context>.
analytics.track(event, properties?, options?, callback?)
Track an event. ReturnsPromise<Context>.
analytics.page(category?, name?, properties?, options?, callback?)
Track a page view. ReturnsPromise<Context>.
analytics.screen(category?, name?, properties?, options?, callback?)
Track a screen view. ReturnsPromise<Context>.
analytics.group(groupId, traits?, options?, callback?)
Associate the current user with a group. ReturnsPromise<Context>.
Calling analytics.group() with no arguments returns the persisted Group instance.
analytics.alias(to, from?, options?, callback?)
Merge identities. ReturnsPromise<Context>.
analytics.reset()
Clear user and group identity. ReturnsPromise<void> / clears persistence.
analytics.ready(callback?)
Run when all plugins are ready. ReturnsPromise<void>.
analytics.user()
Returns theUser instance (id, anonymousId, traits).
analytics.setAnonymousId(id?)
Set (or read) the anonymous ID.analytics.debug(toggle)
Enable or disable debug logging.analytics.register(…plugins) / analytics.deregister(…names)
Register or remove plugins.analytics.addSourceMiddleware(fn)
Add source middleware for all events.analytics.addDestinationMiddleware(integrationName, …fns)
Add middleware for a specific destination.subscribeToPush(analytics, options?) / unsubscribeFromPush(analytics, options?)
Web Push helpers exported from@zixflow/analytics-browser. See Web Push Notifications.