Situation: We want to test two dashboard onboarding flows (A = current, B = new) to see if B increases users who complete onboarding and engage with the dashboard.Primary metric:- Onboarding conversion: proportion of new users who complete the onboarding flow and view at least one core dashboard within 7 days (binary per user).Secondary metrics:- Time-to-first-dashboard (median hours)- 7-day retention (return to dashboard >=1 time)- Downstream engagement (avg dashboards viewed per user in 14 days)- Error/abandonment rate during onboardingRandomization & assignment:- Randomize at user-id level at first app/web session after sign-up to avoid cross-over.- Use deterministic hashing (e.g., hash(user_id) mod 10000 < 5000 → variant A; else B) so assignment is persistent across sessions and platforms.- Exclude internal/test accounts and users with previous onboarding history.Instrumentation:- Track events: onboarding_started, onboarding_completed, dashboard_view (include user_id, timestamp, platform, experiment_id, variant).- Example SQL to compute primary metric:sql
WITH users AS (
SELECT user_id, variant
FROM experiment_assignments
WHERE experiment_id = 'onboard_v2' AND assigned_at <= CURRENT_DATE
),
converted AS (
SELECT u.user_id
FROM users u
JOIN events e ON e.user_id = u.user_id
WHERE e.event_name = 'dashboard_view'
AND e.timestamp BETWEEN u.assigned_at AND u.assigned_at + INTERVAL '7 days'
)
SELECT variant,
COUNT(DISTINCT user_id) AS total_users,
COUNT(DISTINCT converted.user_id) AS converters,
COUNT(DISTINCT converted.user_id)::float / COUNT(DISTINCT user_id) AS conversion_rate
FROM users
LEFT JOIN converted ON users.user_id = converted.user_id
GROUP BY variant;
Sample size calculation (math shown):- Baseline conversion p1 = 0.12 (12%).- Minimum Detectable Effect (MDE) = 10% relative → p2 = 0.12 * 1.10 = 0.132 (absolute difference d = 0.012).- Use two-proportion z-test, α = 0.05 (Zα/2 = 1.96), power = 80% (Zβ = 0.84).- Pooled-ish term p̄ ≈ (p1+p2)/2 = 0.126.Compute:- A = Zα/2 * sqrt(2 * p̄ * (1 - p̄)) = 1.96 * sqrt(2 * 0.126 * 0.874) ≈ 1.96 * 0.469 ≈ 0.919- B = Zβ * sqrt(p1*(1-p1) + p2*(1-p2)) = 0.84 * sqrt(0.12*0.88 + 0.132*0.868) ≈ 0.84 * 0.469 ≈ 0.394- n_per_group = (A + B)^2 / d^2 = (0.919 + 0.394)^2 / 0.012^2 ≈ 1.313^2 / 0.000144 ≈ 1.724 / 0.000144 ≈ 11,972So ~12k users per variant (total ~24k). Round up to 13k / group to be safe.Experiment duration:- Estimate using expected new user inflow. If we onboard ~5k eligible new users/week: 24k / 5k ≈ 5 weeks. Add at least one full business cycle (7 days post-assignment) and 1 extra week for instrumentation/clean-up → recommend run for 6–8 weeks.Guardrails to prevent contamination & false positives:- Pre-launch checklist: verify event fires, experiment IDs, variant rendering, analytics pipeline integrity (QA on sample users).- Persistent assignment to avoid cross-over; block any UI that would allow users to switch flows.- Exclude known bots/internal/test accounts.- Monitor key safety metrics daily (error rate, crash rate, abandonment spikes). If errors in variant B exceed threshold (e.g., >2x baseline error rate or +3 percentage points), pause B immediately.- Pre-register primary metric and analysis plan; fix analysis window (7 days) and stop rules before starting.- No peeking: avoid sequential significance testing without alpha spending correction (use O’Brien-Fleming or Bayesian stopping rules). If interim looks needed, apply Bonferroni or alpha-spending.- Correct for multiple secondary metric tests (Benjamini-Hochberg) and report confidence intervals.- Run balance checks on randomization (demographics, platform, geo) before analysis; if imbalance found, use stratified analysis or include covariates in regression.- Post-experiment: run sanity checks (look for cohort effects, event duplication), and do subgroup analysis only after confirming primary outcome.Result interpretation:- Use both statistical significance and practical significance (effect size vs. cost/effort).- Present absolute and relative lift, CIs, and expected impact on business metrics (e.g., projected increase in active dashboards monthly).This approach ensures the test is powered, instrumented, clean from contamination, and yields actionable results for BI stakeholders.