How to Use Conditions in Chatbots
There are various methods of customising your chatbots to make them act in a specific way. Condition nodes are one of them.
Conditions allow you to narrow down the targets of your bot’s actions by setting up requirements. A Condition can be used when you want to apply a filter based on a polar question. For example, it gives you the possibility to change the way the bot will behave depending on your chat status, the visitor’s browser, or their current URL on your website.
Here’s a list of all of the Conditions that you can use:
- Based on Contact Property
- Operating system
- Returning visitor
- Current URL
- Mailing subscriber
- Chat status
You can find them in the Chatbot editor – they are listed on the right-hand side menu, where you can also find the Triggers and Actions.
Note: All of the Conditions are available only for non-Wix-based websites.
Based on Contact Property
First of all the ‘Based on Contact Property’ Condition, which allows you to select a Contact Property that will determine the flow of your chatbot. You can read more about the Contact Properties here.
You can use attributes like ‘is equal,’ ‘contains,’ or even ‘ends with’ to determine exactly how the bot should behave.
This straightforward Condition lets you determine how the chatbot should proceed based on the visitor’s browser.
Similar in setup to the ‘Browser’ Condition above, the ‘Operating system’ Condition lets you control the chatbot based on the visitor’s operating system (you can choose from both desktop and mobile operating systems),
You can choose if the operating system should be equal (or not equal) to Windows, OS X, Unix, Linux, Android, or iOS.
This Condition enables your bot to act differently towards new and returning visitors on your site. It’s different than using the ‘Visitor returns to the site’ Trigger in your bot – because you can create a flow with another Trigger that you need (e.g. ‘Visitors clicks on chat icon’) and attach that condition, creating a scenario that isn’t possible with just the ‘Visitor returns to the site’ Trigger.
This Condition lets you determine chatbot actions based on the days of the week. Similarly to the previous Conditions, you can use “equal” and “not equal” attributes to manage the flow.
The ‘Current URL’ Condition lets you determine chatbot behaviour based on the page your visitor lands on. Let’s say that you wish to activate a chatbot when a visitor moves their mouse cursor out of the browser window – but you only want that to happen on a specific URL. You can achieve this thanks to the ‘Current URL’ Condition.
The ‘Language’ Condition lets you create a bot that will send automated messages in more than one language (or carry out other actions based on language). The bot will detect the visitor’s default browser language and base its actions on that.
You can read more about how to implement that Condition in an awesome article called “How to Create a Multilingual Bot.”
This Condition allows your bot to filter visitors by their subscription status, and perform actions based on that.
In the example below, the bot sends a warm welcome message to every mailing subscriber who enters a specific page. The bot then asks for an email address and subscribes every non-subscriber.
The ‘Chat status’ Condition lets you adjust your chatbot’s behaviour depending on your chat status: online or offline.
This feature comes in handy when you wish to display a specific chatbot message when your chat is online, and a different one when your chat is offline.
The example above presents a chatbot which sends a warm welcome message to your visitors when your chat status is online, but asks for an email and informs them that you will reach out to them later on when you are not able to respond to the request.
If you have any other questions or face issues, feel free to contact us via chat or at [email protected]