Performance marketing teams still run A/B tests using 2010s frequentist methodology: fixed sample size calculations, p<0.05 gatekeeping, waiting for "statistical significance." You're testing three creative variations on Meta Ads, one is clearly underperforming, but you burn budget for two more weeks because "sample size hasn't been reached." Bayesian A/B testing breaks this cycle: it gives you the right to stop early, quantifies uncertainty, and tells you "this variant wins with 94% probability." With Google Optimize retired and custom test stacks becoming standard, Bayesian math accelerates your decision velocity.
The Fixed Rules of Frequentist Testing
Classical A/B testing works like this: pre-calculate sample size (power analysis: 80% power, 5% alpha, 10% expected lift), wait for that number, check the p-value, decide. The problem: real-world lift often lands at 3%, not 10%. Sample size stretches from two weeks to eight weeks. During that time, creative fatigue sets in, seasonal effects shift, your CPM costs jump 40%. In frequentist logic, early peeking is forbidden—this "peeking" inflates type-1 error rates. Even with sequential testing, alpha-spending functions (Bonferroni, O'Brien-Fleming) add complexity and still demand strict thresholds.
Consider an e-commerce scenario: control variant delivers 2.1% conversion rate, your new checkout flow hits 2.3%. After 1,000 sessions, you have a 9.5% lift, but p=0.12. Frequentist says: "not significant, continue." At 2,000 sessions, p=0.08, still not enough. At 3,500 sessions, p=0.047—finally significant. But at that point, variant B has been live for three weeks, seasonality has shifted, measuring actual gain becomes impossible. Frequentist math delivers a binary verdict: significant or not. Confidence intervals exist, but outside "need 95% CI to decide," they're rarely used.
Bayesian Approach: Probability Distributions
Bayesian statistics ask a different question: "What is the probability that variant B outperforms variant A?" The answer is a continuously updating posterior distribution. Prior belief (domain knowledge) plus data equals posterior. Every new session updates the posterior. At 100 sessions, you get 72% win probability; at 500, 88%; at 1,000, 94%. No fixed threshold—you decide: is >90% enough, or wait for >95%?
The math: beta-binomial model. Conversion rate prior is Beta(α=1, β=1) (uniform); each conversion increments α by 1, each non-conversion increments β by 1. Posterior becomes Beta(α + conversions, β + non-conversions). For two variants, you have two beta distributions. Monte Carlo sampling (10,000 draws) counts how often B > A. Python: scipy.stats.beta.rvs. BigQuery UDFs work too, but Python is faster for sampling.
from scipy.stats import beta
# Variant A: 50 conversions, 2000 impressions
a_alpha, a_beta = 1 + 50, 1 + (2000 - 50)
# Variant B: 58 conversions, 2000 impressions
b_alpha, b_beta = 1 + 58, 1 + (2000 - 58)
samples_a = beta.rvs(a_alpha, a_beta, size=10000)
samples_b = beta.rvs(b_alpha, b_beta, size=10000)
prob_b_wins = (samples_b > samples_a).mean()
# Output: 0.847 → 84.7% win probability
Put this on your daily dashboard: "Variant B wins with 84.7% probability; expected lift 15.3%; 95% credible interval 2.1%, 29.8%." You're not telling your CMO "significant or not," you're quantifying risk. If 85% probability is enough, stop; otherwise, continue. Sequential decision—re-evaluate daily.
Sequential Sampling and Early Stopping Rules
Bayesian's real strength: you can stop whenever you want. In frequentist testing, peeking is forbidden because each look inflates type-1 error. Bayesian has no type-1 error concept (it updates belief rather than testing long-run frequencies). Your stopping rule is your choice: "Stop if win probability >95% or <5%." With this criterion, average sample size drops 30–50% (VWO 2024 benchmark data).
But caution: checking too early still misleads. At 50 sessions, you might see 98% win probability due to random fluctuation. This is where Bayesian regret minimization enters: compute expected value of information (EVOI). EVOI = (expected gain from continuing) - (cost of test continuation). If EVOI turns negative, stop. Practical approach: maintain a minimum sample size floor (e.g., 500 impressions/variant), then apply Bayesian stopping rules.
In Conversion Rate Optimization workflows, Bayesian testing works like this on Meta Ads creative tests: three creative variants, $100 daily budget each. By day 2, variant C is clearly losing (2.1% CTR vs. A/B's 3.8%). Bayesian posterior says 97% "C is losing." Kill C, reallocate budget to A/B. By day 5, A wins with 91% probability; stop B, go all-in on A. Total decision time: 7 days. Frequentist would wait 14.
Expected Loss and Risk Management
Win probability isn't the only metric. Variant B wins 60% of the time, but when it loses, you see an average –8% CR drop; when it wins, +3% CR gain. Switching to B is risky. Expected loss quantifies this: the posterior average of CR difference in the loss scenario. Formula: E[max(0, A - B)]. In Python: numpy.maximum(samples_a - samples_b, 0).mean(). If expected loss is <1% and win probability >70%, switch with confidence.
Decision matrix for Bayesian testing:
| Win probability | Expected loss (CR) | Action |
|---|---|---|
| 94% | 0.3% | Switch immediately |
| 78% | 1.2% | Collect more data |
| 51% | 2.8% | Stop, no meaningful difference |
This table lives on your dashboard. You're not asking the product manager "Should we switch to B?" but saying "B wins 78% of the time, but expected loss is 1.2%—let's gather 200 more sessions." Decision is clear, risk is measured, no wasted time.
Prior Selection and Sensitivity Analysis
Bayesian math depends on prior choice. Uniform prior (Beta(1,1)) is the most agnostic; data dominates. But if you have domain knowledge, use an informative prior: historical tests show CR between 2–3%, so use Beta(20, 980) prior (mean=2%). This stabilizes posterior in the first 100 sessions, reducing random fluctuation.
Test prior sensitivity: run posterior calculations with three different priors (uniform, weakly informative, strongly informative). If win probability shifts >5%, data is insufficient. Example: uniform prior gives 82%, strongly informative gives 77%, difference <5%—proceed with confidence. Difference >10%? Collect more data or recalibrate prior using historical test data.
Prior sensitivity code:
priors = [
(1, 1), # uniform
(10, 490), # weakly informative, mean=2%
(30, 1470) # strongly informative, mean=2%
]
for alpha, beta_prior in priors:
a_posterior = beta.rvs(alpha + 50, beta_prior + 1950, size=10000)
b_posterior = beta.rvs(alpha + 58, beta_prior + 1942, size=10000)
prob = (b_posterior > a_posterior).mean()
print(f"Prior Beta({alpha},{beta_prior}): P(B>A)={prob:.2f}")
If outputs are consistent (±3%), your prior choice is robust.
Closing: Velocity Gains and Organizational Shift
Bayesian A/B testing alone isn't enough—you must also shift organizational decision-making. Move away from the "wait until certain" culture toward "measure risk and move forward." You're offering your CMO 90% probability, not 100% certainty; this requires cultural change. But the payoff is clear: average test duration drops from 14 days to 7, losing variant costs fall 50%, creative iteration velocity doubles. On Meta Ads, this velocity directly translates to ROAS—more tests, better winning creatives, lower CPA. Once Bayesian math is embedded in your dataflow (BigQuery + dbt + Looker), there's no manual calculation, just automatic posterior updates and fresh decision metrics every morning.