You can use the JavaScript SDK to determine which group a user is assigned to by using the getExperiment
API (or getExperimentWithExposureLoggingDisabled
if you need to check without triggering an exposure that would enroll the user into the experiment).
If you are trying to determine if a user has been exposed in the past, our SDKs are not able to return that information. While the SDKs deterministically can return an allocation result that is stable for the user and experiment, they are not historically aware of evaluation results.
For more information, read how bucketing works in Statsig SDKs.
Alternatively, there is an API that returns this information in the form of a daily report. Our data pipelines are aware of historical user assignments, so you can download that information via the Daily Reports Console API endpoint.
When deploying to an environment in Statsig, if you encounter an issue where the RULE
is always Default
and the REASON
is Unrecognized
, it typically means that the SDK was initialized, but the config or feature gate you're trying to evaluate did not exist in the set of values. This could be due to a few reasons:
1. The feature gate or dynamic config you're trying to evaluate does not exist or is not correctly spelled in your code. Please double-check the spelling and case-sensitivity.
2. The SDK might not have been able to fetch the latest rules from the Statsig server. This could be due to a transient network issue. If so, restarting the client or server should fix it, or waiting for a server SDK to poll for updates (by default, every 10 seconds).
3. The Target App you added to the SDK key you are initializing with may not be set on the gate/config/experiment/layer you are checking in your application. If you are using target apps, be double check that the target application on the entity you are checking matches the target application on the SDK key.
4. The gate has no rules in it. Gates return false by default, so a gate with no rules always returns false. Checking a gate that does not exist also returns false. As an optimization, we've removed gates which do not exist from the payload to sdks. So you may see an "Unrecognized" check if the gate has no rules (and therefore returns false anyway)
If you're still having trouble, please provide more details about your setup and the issue, and ask in the Statsig Slack Community.