DecisionReason
Rasuvaeff\Yii3AbTesting\DecisionReason
Enum · rasuvaeff/yii3-ab-testing · Source
Why this variant was served instead of the deterministic hash bucket.
This is the reason axis. Where the value came from is the separate AssignmentSource axis: a sticky-served forced variant is a legitimate combination, so collapsing both into one enum would make it unrepresentable.
Analytics counts only self::Assigned as experiment participation; every other reason is excluded from reports.
Consumers may read values outside this enum from storage: a delivery pipeline that does not know the reason writes fallback_unspecified, which is deliberately absent here because it can be read but never produced.
Cases
| Case | Value | Meaning |
|---|---|---|
Assigned | "assigned" | Deterministic weighted bucket — the only reason included in analysis. |
Forced | "forced" | Explicit override, typically QA. Never enters analysis. |
FallbackDisabled | "fallback_disabled" | Experiment is disabled: the kill switch returned the fallback variant. |
FallbackTargetingMismatch | "fallback_targeting_mismatch" | Targeting rules did not match the assignment context. |
Methods
isFallback()
isFallback(): boolWhether the variant is a fallback rather than a real assignment.
Both fallback reasons answer yes; they stay distinct because a disabled experiment and a targeting miss are different operational situations that v1 could not tell apart.
isAnalyzable()
isAnalyzable(): boolWhether events with this reason belong in experiment analysis.