Skip to content

Experimentation

B2B SaaSMobile appsE-commerce

Run one A/B test across web and mobile apps

Bucket signed-in customers by person instead of browser cookies so someone sees the same variant on desktop web and iOS/Android, and counts once in results.

Deterministic person-unit bucketing. Zero probabilistic IP guessing.

6 min read20 min setupUpdated
Customer seated on a sunlit linen sofa holding his matte smartphone beside a sleek closed aluminum laptop.
Keep one sticky experiment assignment from first mobile web click through iOS/Android app login and paid conversion.

Interactive cross-device power simulator

Model statistical lift when every multi-device user is counted once

Adjust your signed-in participant pool and test split to see clean single-subject lift and confidence when desktop exposures stitch cleanly to mobile purchases.

Illustrative web + mobile app · 30-day person-unit test
12,000

Deduplicated by contact:<id> across laptop, phone, and tablet.

20%

Clean per-person split with zero cross-device contamination.

Live runtime signal20% persistent holdout

Holdout measurement cadence

  1. Day 0Deterministic assignment20% holdout

    2,400 contacts assigned to holdout before first delivery.

  2. 30 daysTwo-proportion readoutSignificant

    +134 incremental conversions verified.

Exposed vs. holdout cohort breakdown

CohortPeopleConversionsRateRevenue
Exposed group9,6005385.6%$49,496
Holdout (20%)2,4001014.2%$9,292

Verified incremental lift

+1.40 pp

$12,328 true incremental revenue

  • Deterministic hashing holds out 2,400 contacts across every channel.
  • 95% confidence interval proves whether lift clears zero before scaling spend.

Attributed total (includes organic)

$49,496

Cannot separate organic buyers from incremental lift

  • Counts everyone who converted after exposure, even people who would have bought anyway.
  • Overstates ROI when seasonal demand or organic brand traffic spikes.

Exposed conversion rate

5.6%

538 / 9,600

Holdout baseline rate

4.2%

101 / 2,400 (20% holdout)

Incremental revenue

$12,328

+134 net conversions

Exposed cohort

5.6%

538 / 9,600

Holdout cohort

4.2%

101 / 2,400

Causal lift & 95% confidence interval+1.4 pp (95% CI +0.4 to +2.4 pp)
+134 incremental conversions ($12,328)p = 0.006

Assumptions: Sample: 12,000 people (80/20 split). Duration: 30 days. Primary metric: Verified cross-device orders. Stopping rule: Fixed window evaluation at 95% confidence. Method: Two-proportion difference with a 95% confidence interval on randomly hashed exposed and holdout groups.

The 95% confidence interval sits cleanly above zero, confirming $12,328 in real incremental revenue.
What this proves

Reconciled headcounts on every screen

Experiment results, exposed subjects, and wiring checks all read the same canonical subject key (contact:<id>), eliminating denominator drift across devices.

The complete playbook

Step-by-step setup, worked math, and real limits.

Steps, technical details, and live pricing.

How it works without Apex

Create an experiment in Apex with randomization_unit set to person, call identify(userId, traits) on login in both your web app (@apex-inc/sdk) and mobile SDK, and optionally sign browser calls with HMAC userHash. Apex assigns the same arm across every device a signed-in person uses, collapses multiple devices back to one canonical subject key (contact:<id>) in results, and keeps staging traffic isolated automatically.

How Apex does it for you

Apex buckets person-unit experiments on the canonical customer record, preserves anonymous device continuity if a browser was bucketed before login, counts every human exactly once across results and wiring checks, and isolates staging/dev builds from production.

How to set this up in 5 steps

  1. Install the Apex web SDK and mobile SDK

    Wire @apex-inc/sdk (or @apex-inc/next for flicker-free SSR) on your web app and install the Apex mobile SDK on iOS or Android.

  2. Call identify(userId, traits) on every login across web and mobile

    Pass your exact stable database or auth userId whenever a customer signs in so Apex links each device deterministically without probabilistic IP guessing, and sign browser identify() calls with server HMAC userHash.

  3. Create the experiment with randomization_unit set to person

    When creating the test in Apex or via create_experiment, switch randomization_unit from visitor (per-device default) to person so signed-in customers receive one consistent arm across desktop and phone.

  4. Forward userId and apex_vid on server-side conversion events

    When purchases or upgrades complete on your backend or Stripe webhook, pass the customer's userId via the Server Events API so mobile checkouts credit the desktop exposure cleanly.

  5. QA on staging with All builds before shipping to production

    Verify arm consistency and single-subject deduplication on staging (where identities isolate under <visitorId>::beta) while production metrics stay at zero.

Deterministic person-unit bucketing

Apex solves cross-device testing natively on the same identity layer that powers your customer profiles, with zero probabilistic IP guessing:

ScenarioCookie-only A/B toolApex (randomization_unit: "person")
Signed-in user visits on laptop and phoneCounted as 2 people; may see both variantsCounted as 1 person (contact:<id>); sees the same variant on both
User reloads the page 4 timesFrequently inflates exposure countsCounted once (first exposure wins)
User sees Variant A on laptop, buys on phoneConversion orphaned from exposurePurchase joins Variant A on the single customer record
Anonymous visitor never logs inCounted as 1 browserCounted as 1 browser (never merged on an IP guess)

Wiring checklist

  1. Install the SDKs: Add @apex-inc/sdk (or @apex-inc/next for flicker-free SSR) on web and the Apex mobile SDK on iOS/Android.
  2. Call `identify(userId, traits)` at login on every surface: Pass your stable user ID and pair browser calls with server-generated HMAC userHash (see Signed sign-ins) so nobody can spoof another customer's ID.
  3. Choose `randomization_unit: "person"`: Use person for tests spanning signed-in web and mobile apps (leaving visitor for pre-login marketing pages). Note that if a browser was already bucketed while anonymous before login, Apex preserves the arm that device already saw so the screen never flickers mid-session.
  4. Forward `userId` on backend conversions: Send Stripe or backend checkout completions through the Server Events API with userId (and apex_vid when available).
Shopper walking down a sunny cobblestone retail street carrying a tote bag and checking her smartphone.
No visitor ever sees a 20% discount banner on mobile web and full price after downloading your iOS app.

Keeping staging QA out of production results

Testing a cross-device experiment on staging or localhost never inflates production metrics. Apex namespaces staging and dev identities under <visitorId>::beta and <visitorId>::dev, defaults every experiment results view to production traffic only, and lets you flip the filter to All builds during QA to confirm cross-device deduplication before shipping. See the full Cross-device experiments reference.

What this costs on Apex

Live Apex pricing · Pay-as-you-go

Estimated Apex cost for Cross-platform app with 15,000 experiment assignments and 30,000 events/month

$0 / month

Covered by monthly free allowances.

Apex meter / scheduleScenario volumeFree allowance / basisRateApex cost
Events
Web + mobile identify and conversion events (30,000 monthly events across web and app)
30,000 / mo1M / month$5 per 100K events$0
Orchestrations
Person-unit cross-device experiment assignments (Consistent variant assignment across web and mobile SDKs)
15,000 / mo1M / month$5 per 100K assignments$0

Signed sign-ins (HMAC userHash) and staging/dev environment isolation are included on every workspace. History: 13 months no card, 3 years with card, 7 years once you've paid an invoice. Live pricing.

Third-party and campaign costs (not paid to Apex)

ExpenseTypical rangeNotes
External CDP or identity resolution vendor$0/moCross-device identity stitching is built into Apex natively

Every meter includes a monthly free allowance that resets automatically, with zero extra charge for cross-device identity stitching or signed sign-ins.

Launch with your AI agent

Create a person-unit cross-device experiment via MCP

Ask your coding agent to create a belief, launch a person-unit experiment that stays consistent across web and mobile, and verify identify() wiring.

1Add Apex to your editor

Install in Grok Build

Opens Grok Build and adds Apex. Nothing to configure.

2Tell your agent

Prompt for your AI editor

In my Apex workspace, call create_experiment with randomization_unit set to person for our unified checkout pricing layout across web and mobile, inspect our identify() calls with get_wiring_status, and check verify_experiment_wiring on staging before activating.

The first time your agent calls Apex, it gives you a link to approve in the browser. There is no key to paste. In Grok Build you can also run /setup-apex.

See how editor setup works step by step

app-monorepo · Grok BuildWaiting for approval
Agent
You

Set up Apex in this repo.

Set up Apex · 0 of 4
  • Signed in
  • Workspace named
  • Events arriving
  • Conversion picked
  • Stripe

Your move

One customer, one variant, counted once across every screen.

Wire identify() on web and mobile in 20 minutes and eliminate variant flip-flopping and double-counted denominators.