1. Docs
  2. Survey Logic

How Do Random Conditions Work?

Random conditions let you run A/B tests and randomized trials by automatically generating randomized survey conditions at the beginning of a survey.

What Are Random Survey Conditions?

Survey conditions are variables that you can write to and read from throughout a survey in order to conditionally show certain questions and create branching logic.

Random survey conditions are just like normal conditions, except they are assigned some random value at the beginning of the survey. For example a survey with random conditions might load with the URL:

https://survey.phonic.ai/60915bd7f248f3c0cae00765

And it would re-load with conditions applied:

https://survey.phonic.ai/60915bd7f248f3c0cae00765?condition_1=some_random_value

How Do I Enable Random Conditions?

Random conditions can be turned on in Survey Settings > Random Conditions.

Screen Shot 2022-09-12 at 1.59.21 PM

You can create any number of individual conditions, and assign each condition an arbitrary number of values. Each value also has a corresponding weight, so in the example below the condition "condition 1" will be set to A 50% of the time and B the other 50% of the time since the weights are equal.

The condition weights are integers and do not have to add to any specific number.

Screen Shot 2021-05-05 at 11.28.12 PM

Referencing A Random Condition

Random conditions can be referenced in survey logic just like any other condition.

Screen Shot 2021-05-07 at 3.18.42 PM

Overriding Random Conditions

Sometimes it's necessary to test a random condition arrangement. Rather than refresh the survey link until the required arrangement comes up, you can override some or all conditions by passing them explicitly as URL parameters.

https://survey.phonic.ai/60915bd7f248f3c0cae00765?overriden_condition=123