How to use Conditional Logic
What is conditional logic?
Conditional logic allows you to create rules for your customers to meet. These rules can be used to direct customers down different, more relevant parts of your bot's conversation.
Once you set up a set of conditional logic rules there will be 2 paths created that your customers can go down. The first path is the TRUE path, this is when a customer meets all the requirements of the rules. The second path is the FALSE path, this is the path that your customer will be taken if they don't meet the requirements of your rules.
Why is this useful?
It creates a much more personalised and human experience for your customers. An example would be setting a conditional logic rule to check if a customer's email is known. So If the customer has visited before and you already know their email address they could go down the TRUE path which would let them skip the email address question.
This removes any repetitive questions making customers experience better and increases their chances of completing the conversation.
In this article we cover:
- How to use conditional logic
- Available rules for conditional logic
- How conditional logic appears in the preview
- How to use custom variables in conditional logic
- When to use Match all these rules or Match any of these rules
How to use Conditional Logic
Conditional logic is an object that is set inside the messages section of your bot. To start using conditional logic you need to find the bot you wish to edit, then go to the messages section inside the bot builder.
Available rules for Conditional Logic
We are always working on increasing the rules that can be used in Conditional Logic. Currently you can set rules using the following rules :
- Your custom variables
- Your lead's profile data like : (name, email, company, phone, first seen, last seen, whether or not they accepted your privacy)
- Your lead's context like:( the current page URL, the referral page, the device they are using, the country they are visiting from, the time of the day, the day of the week, or a specific date)
- Your team availability for livechat
How Conditional Logic appears in the preview
Conditional logic will never be seen by the customer when it is like on your site.
However, for testing purposes, we do show you when you reach a conditional logic object in the preview. We show you the different rules that are set and ask you to make a choice of whether you want to go down the TRUE or FALSE path.
Using custom variables with Conditional Logic
When a customer answers a question in your bot's conversation, you can store that answer in a custom variable. This custom variable can then be used to set a conditional logic rule.
In this example, I am going to use a conditional logic rule to check if the customer's answered yes to an earlier multiple choice question.
When to use Match all these rules or Match any of these rules
You are able to set multiple rules for one conditional logic object. You have a choice on how you want the logic to be determined as TRUE or FALSE.
Match all these rules
This option means that all of the rules that are set in your conditional logic object will need to be true in order for the customer to be taken down the TRUE path.
Match any of these rules
This option means that you can set multiple different rules but as long as one requirement is matched then the customer will be taken down the TRUE path.