isHypothesisActive()
Check whether the current visitor is assigned to a specific test variant.
isHypothesisActive()
Signature
window.shoplift.isHypothesisActive(hypothesisId: string): Promise<boolean>Parameters
Parameter
Type
Required
Description
Returns
Value
Meaning
Basic Usage
const isVariant = await window.shoplift.isHypothesisActive(
'aa800953-3e22-4335-a53b-50f61db17538'
);
if (isVariant) {
showVariantExperience();
} else {
showControlExperience();
}Behavior by Trigger Type
Automatic Trigger
Manual Trigger
Return Value Scenarios
Returns true when:
true when:Returns false when:
false when:Error Handling
Caching
URL Parameter Overrides
Parameter
Effect
Last updated
Was this helpful?