Supported on: iOS SDK
1.0.61+Two ways to run an experiment
- Servable surface experiments — A/B test a whole paywall, onboarding flow, in-app message, or survey with no branching code. You design the variants in the Console and the SDK serves the right one automatically. Best for testing the content or design of a managed surface.
- Code-level experiments — read the assigned variant yourself with
getVariantorgetExperimentConfigand branch in your own code. Best for feature flags, custom UI, or logic that isn’t a managed surface.
Servable Surface Experiments
Supported on: iOS SDK
1.0.65+- Treatment cohort → renders the treatment’s configuration in place of the live entity.
- Control cohort (and users on older SDK versions) → renders the live entity unchanged.
Get Variant
"control", "variant_a", etc.) or nil if the experiment is not found, not running, or the user is not in the target audience.
Check a Specific Variant
true only if the user is currently bucketed into the named variant. Useful as a guard before rendering variant-specific UI.
Get a Per-Variant Config Value
When an experiment variant carries a config payload, read individual keys with:Any? (string, number, boolean, array, or dictionary depending on what the Console stored).
Module Access
Module Methods
The top-level
AppDNA object also exposes AppDNA.getExperimentVariant(experimentId:), AppDNA.isInVariant(experimentId:variantId:), and AppDNA.getExperimentConfig(experimentId:key:) as convenience methods that delegate to this module.
Exposure Tracking
The SDK tracks anexperiment_exposure event once per session the first time getVariant() is called for a given experiment. Calling it multiple times in the same session does not create duplicate events.
To inspect which experiments the user has been exposed to in the current session:
Experiment Lifecycle
Full Example
Experiments are created and managed in the Console under Experiments. The SDK uses MurmurHash3 for deterministic assignment — the same user always gets the same variant across sessions, platforms, and even offline.

