If you would like to A/B test two or more strategies, you can create a group for A/B testing, and use a custom pre-processor to send products to different strategies in a "random" way.
Here is a basic code for the custom pre-processor as an example:
import random
ctx = get_context()
variables = ctx.get_variables()
num_of_strategies = len(variables)
num = random.choice([0, num_of_strategies -1])
strategy_id = variables.values()[num]
ctx.log("A/B testing: chose strategy " + str(strategy_id))
ctx.set_strategy_id(strategy_id)
Under the variable section you can define as many "strategy" variables as you would like:
[
{
"field": "Select strategy A",
"kind": "strategy"
},
{
"field": "Select strategy B",
"kind": "strategy"
}
]
When you define it in a pricing group, you will be able to choose the different strategies for the A/B testing.
This is how the example above looks in the UI:

Comments
0 comments
Please sign in to leave a comment.