On this page

For AI agents: a documentation index is available at /llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.

Switchback V2

Run switchback experiments in Statsig to alternate treatment exposure across time windows for marketplace, ranking, and other globally shared systems.

A switchback experiment alternates an entire cluster of users between control and treatment on a fixed schedule, then compares time windows instead of user groups. Use it when treating one user changes what other users experience, such as pricing in a marketplace or a shared ranking model. For example, on a rideshare platform, offering lower prices to a treatment group can increase demand for cars and indirectly affect control riders; a switchback experiment measures the impact over time instead of splitting users. If user experiences are independent, run a standard A/B test instead.

Switchback V2 is available in Statsig Warehouse Native. Statsig Cloud projects run switchback tests.

How switchback experiments work

  1. Define clusters and their schedule: A cluster is a group of users that switch between experiences on the same cadence. For example, all users in New York and Chicago follow the same hourly schedule.
  2. Aggregate data by time buckets: A bucket is a single window of time during which the user experience stays constant. The analysis treats each bucket as one data point.
  3. Run regression analysis: Statistical models account for factors such as time of day, day of week, or cluster attributes when estimating the difference between treatment and control.
  4. Compare results: The final output resembles a traditional A/B test, including metrics such as estimated lift and confidence intervals.

The following schedule for the New York and Chicago cluster produces four buckets: two for control and two for treatment.

Set up a switchback experiment

Defining the hypothesis, metrics, groups, targeting, and parameters follows the same workflow as a traditional A/B test. A switchback experiment adds three configurations: clusters, scheduling, and analysis configuration.

Define clusters

Clusters are groups of users who follow the same experience cadence. In a traditional A/B test, the selected ID type is both the randomization unit and the unit at which Statsig calculates metrics. In a switchback experiment, the ID type defines only the unit for metric calculation, and clusters determine which experience a user receives over time.

Statsig provides three ways to define a cluster.

You can use the Cluster ID Type (Auto) and Cluster Field (Manual) fields as covariates in the regression analysis, and to break down metric data in the results section.

Define the schedule

After you configure the clusters, define the schedule for experiences within each cluster.

Switchback schedule configuration with window size, start date, and target duration

Schedule fields

Define analysis configuration

You can configure how Statsig handles exposures and metrics during the transition periods between switchback windows. For example, a rideshare marketplace might switch from control to treatment at 9 AM. The system can still show lingering effects from the control period, such as drivers on active trips or riders still in the queue from earlier periods. In these cases, you can exclude exposures and metric data recorded shortly after the switch.

Configure burn-in and burn-out periods in the Analysis Configuration section to exclude these transition exposures.

Analysis configuration section with burn-in and burn-out period fields

Analysis configuration fields

Metric calculation options:

Metric Calculation drop-down with the three aggregation options

Exposure calculation options:

Exposure Calculation drop-down with include and exclude options

Coming soon: pre-computed user dimensions. You can configure user dimensions from the exposure user properties or entity properties to break down experiment results in the results section.

Was this helpful?