Supported on: Android SDK
1.0.33+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: Android SDK
1.0.37+- 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
null if the experiment is not found, not running, or the user is not in the target audience. The convenience method AppDNA.getExperimentVariant("paywall-test") is equivalent.
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 carries a config payload, read individual keys with:Any? (string, number, boolean, list, or map depending on what the Console stored).
Exposure Tracking
The SDK records experiment exposures automatically the first timegetVariant() is called for a given experiment in a session. Exposures are tracked as part of the standard analytics pipeline and surface in the Console experiment results.
To inspect the active exposures (useful for debugging or attaching them to your own analytics events):
List<ExposureEntry> where each entry has experimentId: String and variant: String.
Module Access
Module Methods
| Method | Signature | Description |
|---|---|---|
getVariant | getVariant(experimentId: String): String? | Get the assigned variant, or null if not eligible |
getExposures | getExposures(): List<ExposureEntry> | Snapshot of all active exposures (experiment → variant) |
AppDNA object also exposes AppDNA.getExperimentVariant(experimentId), AppDNA.isInVariant(experimentId, variantId), and AppDNA.getExperimentConfig(experimentId, key) as convenience methods that delegate to this module.
Experiment Lifecycle
| Status | getVariant() returns |
|---|---|
| Draft | null — not visible to SDKs |
| Running | Assigned variant string |
| Completed | Winning variant for all users (server-side decision) |
| Archived | null — removed from config |
Full Example
Experiments are created 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.
Next Steps
- Use Feature Flags for typed boolean rollouts
- Combine experiments with Remote Config for variant-scoped values
- Present Paywalls using
PaywallContextto attribute conversions to the experiment

