You may have several different versions of a Playbook that you'd like to try to see which gets the most engagement. We've created a script for you so that you can assign a cookie at random on every page load where the Playbook should fire!
Note: The details of this article are for customers on the Drift Advanced and Enterprise Customers. You'll find instructions on how to do A/B testing for Premium and legacy Drift plans, and for Essential plan at the bottom of this article.
Please note that A/B testing on low volume playbooks may not yield accurate reporting results.
In this doc we'll cover:
- Advanced above
- Essential Plan
For Advanced and Above
To do A/B testing between two playbook flows, all you need to do is first, click the "Create A/B test" button.

This will split your playbook into two flows, flow A, the control flow, and flow B, the test flow. Once you click "create" your playbook will look like this:

Now, make any edits you'd like to on playbook path B. Please note that whatever was previously built out in the bot flow will become the starting point for both flows A and B. Once you've built out bot flow B you'll want setup your targeting conditions!
Note: If you see an error that says "cant' save playbook due to size" when testing it means the playbook is too large to be saved. To get around this, try using blocks to build your playbook.
Note for Enterprise users: If you'd like to have a copy of all the text on a bot, you can download your bot text as a CSV. To do so, check out our doc here.
Targeting
Setting up targeting your A/B test playbooks works just like targeting for any other playbook! Simply set the conditions you would like your playbook to fire under and we'll take care of the rest. Once your condition is set any visitor that matches the criteria will be divided in half and half the visitors that meet your targeting conditions will be shown bot flow A, while the other half will be shown bot flow B.

Starting the test
Your A/B test playbook flows won't be live on your site until you initiate the test. In order to this you just need to click the "Start A/B test" button at the top of the page!

Once your A/B test is active you will not be able to make edits to the current playbooks flows!
Edit or end the test
Do you need to make an edit to one of your bot flows or is there a clear front runner in your A/B test? Then it's time to end the A/B test! This can be done by clicking the "End A/B test" button at the top of the screen.

This button will give you two options, "Choose winner" and "Edit and restart". Selecting "Choose winner" will open a window showing you stats about how each bot flow performed allowing you to choose which one you would like to use going forward. Whichever flow you select here will become the flow the playbook uses.

Selecting the "Edit and restart" option will simply end the test and allow you to edit each individual bot flow.
For customers on Premium and Legacy Drift Plans
To do A/B testing between two playbooks, all you need to do is first, clone your playbook.
You can do this by selecting Clone on the playbook you'd like to clone. Make sure you leave the rollout % at 100% for the original, non cloned playbook.

Next, on your cloned playbook, set the rollout % to 50%

Now, you'll make whatever changes you'd like to your cloned playbook, and then set the priority of the cloned playbook to be 1 notch higher than the existing playbook.

Now just publish your newly cloned playbook! Since only 50% of visitors will see this newly cloned version, and the other 50% will "flow through" and see the old, previous published version.
Note for Enterprise users: If you'd like to have a copy of all the text on a bot, you can download your bot text as a CSV. To do so, check out our doc her
For customers on the Essential Plan
Place this code directly after the Drift Embed script and use Audience targeting to add a Cookie targeting condition!
<script>
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
}
var random = getRandomInt(1,100);
if( random <= 50 ) {
document.cookie = "DriftPlaybook=A"
} else {
document.cookie = "DriftPlaybook=B"
}
</script>
Setting Up Audience Conditions for Your Playbook
From the Playbooks tab, click into any existing Playbook in your account or create a new Playbook from the Marketplace!

Once you select the playbook, navigate to the Targeting Section.

Select visitors who match all of the conditions in any of the following groups from the Audience section near the top.
From there, select Cookie from the dropdown, by finding it under the Visitor behavior category.
Select Contains as your variable.
Add DriftPlaybook=A as your cookie.

You can now do A/B testing with Cookies using this set up.