To retrieve currently active experiments using JavaScript in the browser console, you can use the Statsig.getExperiment
or Statsig.getLayer
methods. However, these methods require you to know the name of the experiment or layer. There is no documented method to retrieve all active experiments without knowing their names.
For group overrides, there is no documented method to retrieve group IDs directly. However, you can use the Statsig.overrideConfig
method to override the value of a specific experiment for a specific user. The value you provide should match the structure of the experiment's parameters. Here is an example:
javascript
Statsig.overrideConfig("a_config_or_experiment_name", { key: "value" }, "a_user_id");
In this case, { key: "value" }
should match the structure of the parameters for the experiment you're trying to override. There is no documented way to override groups directly using group IDs.
If you're unsure about the structure of the experiment's parameters or need further assistance, it is recommended to reach out to the Statsig team for more specific guidance.
Please note that it may not be possible to override the group. You can only override the config object that's returned by a getExperiment
call.