Prompt
How do I run A/B tests across web and mobile at the same time?
Latest observation
To run A/B tests across web and mobile at the same time, the key is to treat them as one experiment with multiple surfaces, not two separate tests.
1) Define one experiment hypothesis
Write a single hypothesis that applies to both platforms, for example:
- “Showing a shorter signup flow will increase completed registrations.”
- “New pricing page layout will improve trial starts.”
Then define:
- Primary metric: one main success metric
- Guardrail metrics: e.g. crash rate, latency, refunds
- Segment metrics: web vs iOS vs Android
2) Use a shared experiment ID and assignment logic
Assign users consistently across platforms using:
- a central experimentation service, or
- a shared decisioning API, or
- the same bucketing algorithm with a common user identifier
Best practice:
- Bucket by a stable cross-platform ID like
account_id,login_id, or unified user ID - If users are anonymous on web and mobile, consider an identity merge strategy after login
This prevents one person from getting variant A on web and B on mobile.
3) Randomize at the right level
Choose the unit of assignment carefully:
- User-level randomization: best for most product tests
- Account/org-level randomization: if teams or households share devices
- Session-level randomization: only for very short-lived UI tests; usually not ideal across platforms
For web + mobile together, user-level is usually the right choice.
4) Keep treatments functionally equivalent
Make sure variant A and B are comparable across platforms:
- Same product logic
- Same eligibility rules
- Same messaging intent
- Platform-specific UI adaptations allowed, but don’t change the underlying treatment too much
Example:
- Web gets a modal
- Mobile gets a full-screen sheet But both represent the same experimental concept.
5) Instrument events consistently
Use a unified event schema across web and mobile:
experiment_exposuresignup_startedsignup_completedpurchase_completed
Capture:
- platform
- variant
- user ID
- timestamp
- device/app version
- session ID
Without consistent logging, you can’t combine results correctly.
6) Analyze by platform and overall
Report results in two layers:
Overall
Combines web + mobile to answer:
- “Did the experiment work across the whole product?”
By platform
Shows:
- web lift
- iOS lift
- Android lift
This helps catch cases where:
- the treatment helps web but hurts mobile
- platform UX differences change impact
- app constraints make the experience inconsistent
7) Watch for cross-platform contamination
A common issue is users seeing different variants on different devices.
To minimize this:
- Use login-based identity
- Sync assignment server-side
- Persist assignment centrally
- Avoid local-only randomization in cookies/device storage
8) Decide how to handle traffic splits
Typical options:
- Global 50/50 split across all users
- Stratified split by platform so each platform gets balanced traffic
- Holdout control shared across platforms
If web and mobile traffic volumes are very different, stratified assignment is often safer.
9) Consider sample size and power
Because web and mobile traffic differ, you may need:
- enough total sample for the main result
- enough per-platform sample to detect platform-specific effects
If one platform is much smaller, you may need to:
- extend the test duration, or
- treat platform analysis as exploratory
10) Use an experimentation platform if possible
Tools like Optimizely, Statsig, LaunchDarkly, GrowthBook, Amplitude Experiment, or in-house systems can:
- assign variants consistently
- support SDKs for web and mobile
- log exposures/events
- unify reporting
Practical setup pattern
A common architecture is:
- User logs in on web or mobile
- Client calls a central experiment service with
user_idandexperiment_key - Service returns variant
AorB - Client renders the variant for that platform
- Exposure and conversion events are logged with the same experiment/variant ID
- Analysis aggregates all platforms and also breaks out by platform
Common pitfalls
- Randomizing separately on each platform
- Comparing raw conversion rates without normalizing exposure windows
- Ignoring identity resolution across devices
- Using different definitions of conversion on web vs mobile
- Testing too many platform-specific changes at once
If you want, I can also give you:
- a recommended architecture diagram,
- a step-by-step implementation plan, or
- SQL / analytics logic for combining web and mobile A/B test results.