Skip to main content

SDK autogenerated metrics

In addition to automatic exposure logging, the statsig-js sdk logs events to help diagnose the impact of new features.

This automatic logging is controlled via the StatsigOptions parameter to initialize - if you'd like to disable this behavior, you can turn on the disableErrorLogging or disableAutoMetricsLogging flags.

statsig::app_error

If this event is not disabled, the sdk will listen for javascript errors, and log an event to Statsig. This can help you analyze if a new feature or experiment is causing an increase in client side exceptions

See the code snippet here

To disable, set disableErrorLogging to true in StatsigOptions.

statsig::app_metrics

If this event is not disabled, the sdk will log an event to Statsig with a few browser performance metrics. This can help you analyze if a new feature or experiment is impacting the performance of your app.

The statsig::app_metrics event value is the entryType as defined on the mdn web docs.

The event metadata has three fields, derived from a navigationEntry on window.navigation

pageLoadTimeMs: navEntry.duration,
domInteractiveMs: navEntry.domInteractive - navEntry.startTime,
redirectCount: navEntry.redirectCount,

See also:

See the code snippet here

To disable, set disableAutoMetricsLogging to true in StatsigOptions.