A/B testing the bot jump logic branches
If you want to create custom jumps based on the A/B experiment value you will need to do the following:
Step 0: Enable developer mode:
![](https://academy.quriobot.com/how-to-build-an-advanced-bot/a-b-testing-the-bot-jump-logic-branches/27562.en-us_hu1f76929b06d22062d54cd037b6988a56_48350_20x0_resize_box_3.png)
Step 2: Add a script variable, name - experiment, type - script:
function(callback, variables) {
// The `callback` argument has to be called with the result value in order to support the async operations. The `variables` argument is an object containing other variables
var experiments = ['1', '2', '3'];
var experiment = experiments[Math.floor(Math.random() * experiments.length)];
callback(experiment)
}
Step 1: Add a GoTo Step that uses the value of this variable ({{experiment}} in this example) and create your Response and corresponding Jump logic based on the value
![](https://academy.quriobot.com/how-to-build-an-advanced-bot/a-b-testing-the-bot-jump-logic-branches/27564.en-us_hu2b54684809b6305e591bc593ef31e910_30708_20x0_resize_box_3.png)
![](https://academy.quriobot.com/how-to-build-an-advanced-bot/a-b-testing-the-bot-jump-logic-branches/27565.en-us_hu70fb2b3ebb448e10f53048b206f18349_162150_20x0_resize_box_3.png)
![](https://academy.quriobot.com/how-to-build-an-advanced-bot/a-b-testing-the-bot-jump-logic-branches/27566.en-us_hua9cb774d5a033e2a5d9766735a9b9988_174822_20x0_resize_box_3.png)
![](https://academy.quriobot.com/how-to-build-an-advanced-bot/a-b-testing-the-bot-jump-logic-branches/27567.en-us_hud2d9fc409dc50820772fbaf1f2d8772a_177296_20x0_resize_box_3.png)
That’s it! By randomly selected experiments (from 1 to 3), the bot will jump to either theΒ first, second, or third branches of the flow.