A/B testing is central in any data-driven product. Apache Superset allows building robust A/B dashboards to track variants, calculate statistical significance, and drill down by segment. This guide details the methodology in 2026.
1. A/B testing architecture
- Tracking tool: Optimizely, GrowthBook, Statsig, Unleash, or homemade;
- Events: exposure (assigned variant) + conversion;
- Storage: warehouse (BigQuery, ClickHouse);
- dbt modeling:
fct_experiments,fct_exposures; - Superset: steering dashboards.
If you want Superset ready for A/B testing, TVL Managed Superset offers A/B templates on Pro+ instances.
2. Data model
CREATE TABLE fct_exposures (
user_id INT,
experiment_id VARCHAR,
variant VARCHAR,
exposed_at TIMESTAMP
);
CREATE TABLE fct_conversions (
user_id INT,
experiment_id VARCHAR,
conversion_event VARCHAR,
converted_at TIMESTAMP,
value DECIMAL
);
3. Essential A/B KPIs
| KPI | Formula |
|---|---|
| Conversion rate | Conversions / Exposures per variant |
| Relative lift | (Variant − Control) / Control |
| Absolute lift | Variant − Control |
| p-value | Chi-2 or Z-test |
| Confidence interval | ±1.96 × SE at 95% |
4. Typical SQL query
WITH exp AS (
SELECT
e.experiment_id,
e.variant,
e.user_id,
CASE WHEN c.user_id IS NOT NULL THEN 1 ELSE 0 END AS converted
FROM fct_exposures e
LEFT JOIN fct_conversions c
ON c.user_id = e.user_id
AND c.experiment_id = e.experiment_id
AND c.converted_at >= e.exposed_at
AND c.converted_at <= e.exposed_at + INTERVAL '7 days'
)
SELECT
experiment_id,
variant,
COUNT(*) AS exposures,
SUM(converted) AS conversions,
AVG(converted) AS conversion_rate,
ROUND(AVG(converted) * 100, 2) AS conversion_pct
FROM exp
GROUP BY experiment_id, variant;
5. Essential A/B dashboard
- List of active experiments;
- Variant performance per experiment;
- Lift and p-value;
- Evolution over time;
- Segment drill-down (mobile, desktop, B2B, B2C).
This configuration is applied by default on TVL Managed Superset, which follows community best practices.
6. Calculate p-value in SQL
-- Z-test approximation for two proportions
WITH stats AS (
SELECT
SUM(CASE WHEN variant='control' THEN converted END) AS c_conv,
SUM(CASE WHEN variant='control' THEN 1 END) AS c_n,
SUM(CASE WHEN variant='treatment' THEN converted END) AS t_conv,
SUM(CASE WHEN variant='treatment' THEN 1 END) AS t_n
FROM exp
)
SELECT
(t_conv * 1.0 / t_n - c_conv * 1.0 / c_n) AS lift_absolute,
-- z-score
((t_conv * 1.0 / t_n - c_conv * 1.0 / c_n)
/ SQRT(...)) AS z_score
FROM stats;
For rigorous tests, calculate on Python side (scipy) before sending to Superset.
7. Common pitfalls
- Peeking: looking at results before the planned duration → false positives;
- Multi-comparison: testing 10 variants increases false positive risk;
- Sample ratio mismatch: if unbalanced exposures, bias;
- Novelty effect: a variant performs better in early days then regresses;
- No power analysis before launching.
8. Best practices
- Define the hypothesis and main KPI BEFORE the test;
- Power analysis to set the necessary duration;
- Stoppage only at planned duration, or via Sequential Testing;
- Document each experiment in a Git repo;
- Calculate p-value on SQL side or via a specialized platform (GrowthBook).
9. Conclusion
Apache Superset is an excellent visualization tool for A/B testing. For advanced analyses (sequential testing, Bayesian, multivariate), rely on specialized platforms (GrowthBook, Statsig) that expose their data in the warehouse, and keep Superset as the visualization and alerting layer.
Want the benefits of Apache Superset without the friction of installation and maintenance? Deploy your instance in 3 clicks with TVL Managed Superset, hosted in Europe (OVHcloud, Roubaix, France).
For more: product analytics, funnel analysis, cohort analysis.