Using Autocapture
Sidecar automatically tracks various web activities, allowing you to create both simple and complex Metrics within Statsig console without writing a line of code. Create a new metric in the Metrics tab on the Statsig console to get started, and read more about the metrics we automatically log in Autocapture on the Web. See Autocapture on the WebUsing the tracking API
You can track events manually for actions that are not autocaptured by the feature described above. To track events back to Statsig, you can callStatsigSidecar.logEvent which takes the same arguments as the Statsig JS SDK as documented here. This method can be called prior to completion of the init routine.
Per-assignment callback for outbound integrations
You can bind a callback that gets invoked each time Sidecar activates an experiment assignment, including experiments activated later by prerun scripts. This method should be defined anywhere prior to the Sidecar client script.event.name- always"experiment_evaluation"event.experiment- the full Statsig experiment objectevent.experimentName- the Sidecar experiment name, or the Statsig experiment name as a fallbackevent.groupName- the assigned group / variant, ornullif unavailable
Post-Experiment Callback for one-time readiness hooks
You can still bindwindow.postExperimentCallback if you need a callback after Sidecar finishes its initial run. This callback can fire even when there are no experiments, and it does not cover experiments that are activated later by prerun scripts.
Disabling All Logging
To disable all logging to statsig (both autocapture events and logging who has seen your experiments) append the following query string parameter to the Sidecar script URL:&autostart=0. This may be useful if you’re dealing with GDPR compliance, and you can later re-enable events with client.updateRuntimeOptions({disableLogging: false})