The OR and the AND operators are the ones used to create a more advanced segmentation for your experiments.

1.  Cases related to the OR operator

When using the “OR” operator, at least one of the conditions mentioned must be met. In other words one out of two must be true.
Below we present you some examples of cases with two conditions ( the example applies to more than 2 ) in which you will use the “OR” operator and what happens :

Case 1 – visitor meets parameter #1

Parameter #1 : True
OR
Parameter #2: False

Example:

You want to include into your experiment only the users that are Returning Visitors or the ones that are coming from Organic Traffic.

The first condition is met (True -the user is a returning visitor) and the second one is not (False – the user did not come from Organic Traffic), the experiment will apply, because at least one of them is True / Valid.

Case 2 – visitor meets parameter #2

Parameter #1: False
OR
Parameter #2: True

Example:

You want to include into your experiment the users that come from USA or Canada. If a user lands on the experiment and does not meet the first condition (False – the user is not from USA), but meets the second one (True – the user is from Canada) the experiment will apply, because at least one of them is True / Valid.

Case 3 – visitor meets both parameters

Parameter #1: True
OR
Parameter #2: True

Example:

You want to include into your experiment only the users that come from a Mobile Device or from an Organic Traffic source.

In this case if either of the two conditions is true or both of them are, the experiment will apply.

The experiment won’t apply if the following situation occurs:

Case 4 – The visitor does not meet any of the parameters

Parameter #1: False
OR
Parameter #2: False

Example:

You want to include into your experiment only users that come from Greece or Italy.

If the user comes from USA (False – the user is not from Greece or Italy) none of the conditions will be met and the experiment won’t apply.

2. Cases related to the AND operator

When using the “AND” operator, both conditions must be met for the experiment to apply.
Below we present you some examples of cases with two conditions ( the example applies to more than 2 ) in which you will use the “AND” operator and what happens :

Case 1 – visitor meets both parameters

Parameter #1: True
AND
Parameter #2: True

Example:

You want to include into the experiment only the visitors that are New Users and that spent at least 5 minutes on your website(Time on site in current session parameter).

In this case both conditions need to be true in order for the experiment to be applied.

The experiment won’t apply in the following situations:

Case 2 – visitor does not meet parameter #2

Parameter #1 : True
AND
Parameter #2: False

Example:

You want to include into your experiment only the visitors that are Returning Users and that have visited your website at least three times (Count visits parameter). 

If one of the conditions is not met (either the user is new or has not visited the website at least three times), the experiment won’t apply.

Case 3 – visitor does not meet parameter #1

Parameter #1: False
AND
Parameter #2: True

Example:

You want to include into your experiment only the users that have visited the category page into your website (URL’s visited in current session parameter) and came from a certain AdWords Campaign (utm_campaign parameter).

If the user has seen only the home page (False – he did not see the category page yet) and came from the targeted AdWords campaign (True – the utm_campaign parameter was met), the experiment won’t apply because one of the parameters is False/Invalid.

Case 4 – visitor does not meet any of the parameters

Parameter #1: False
AND
Parameter #2: False

Example:

You want to include into your experiment only the users that come from a place where the weather is sunny (Weather condition parameter) and the Weather Temperature is greater than 25 degrees Celsius.

If the user comes from a place where the weather condition is cloudy (False – the weather condition is not sunny) and the temperature is 20 degrees Celsius (False – the weather temperature is lower than 25 degrees Celsius), the experiment won’t apply because both of the parameters are False/Invalid.

A very important aspect is that the ‘AND’ condition has a higher priority than the ‘OR’ condition and also it is not a flexible condition (if one of the parameters is false, the whole statement will become false).