How are the A/B test variants of the users determined?

Question

How are the A/B test variants of the users determined?

Answer

We use 64-bit consistent hashing of the user IDs combined with the A/B test ID. Hashing is done via the MD5 algorithm. It's used to map a string to a 64-bit numeric value.

We divide the hash number by 100 and take the reminder, which we use as a bucket. The bucket determines which variant the user will fall into.

For example, if we have variant A with 50% of the population and variant B with 50%, a bucket number of 0 through 49 will mean you fall into the first variant and 50 through 99 means you'll get to be in the second one.

This results in a consistent method of distributing users across A/B test variants with the desired proportions.


Was this article helpful?
Have more questions? Submit a request