I'm trying to do A/B testing the Bayesian way, as in Probabilistic Programming for Hackers and Bayesian A/B tests. Both articles assume that the decision maker decides which of the variants is better based solely on the probability of some criterion, e.g. $P(p_A > p_B) = 0.97 $, therefore, $A$ is better. This probability doesn't provide any information on whether there was sufficient amount of data to draw any conclusions from it. So, it is unclear to me, when to stop the test.
Suppose there are two binary RVs, $A$ and $B$, and I want to estimate how likely it is that $ p_A > p_B $, and $ \frac{p_A - p_B}{p_A} > 5\% $ based on the observations of $A$ and $B$. Additionally, suppose that $p_A$ and $p_B$ posteriors are beta-distributed.
Since I can find the $\alpha, \beta$ parameters for $p_A\,|\,\text{data} $ and $p_B\,|\,\text{data} $, I can sample the posteriors, and estimate $P(p_A > p_B\ |\ \text{data})$. Example in python:
import numpy as np
samples = {'A': np.random.beta(alpha1, beta1, 1000),
'B': np.random.beta(alpha2, beta2, 1000)}
p = np.mean(samples['A'] > samples['B'])
I could get, for example, $P(p_A > p_B) = 0.95$. Now I would want to have something like $P(p_A > p_B\ |\ \text{data}) = 0.95 \pm 0.03$.
I have researched about credible intervals and Bayes factors, but can't understand how to calculate them for this case if they are applicable at all. How can I calculate these additional stats so that I'd have a good termination criterion?