Conditional blocks target specific content to different customers depending on variables associated with them.
You can’t use variables from your Actions when you’re setting conditions. This is because you can’t control when your customer might trigger an Action, so you can’t depend on your AI Agent having that information when it needs to use it.
The Conditional block uses logic to decide whether it should serve content to customers. Sometimes this is called “if-then-else” logic. Here’s how it works in Ada:
Create conditions to deliver targeted content to customers based on variable values.
To create a Conditional block:
Create a condition. On the dashboard, your first condition is indicated with the
symbol.
If you want your condition to work with multiple criteria, you can choose how that behavior works. Select either If all of or If any of in the dropdown list. With this option, you can create multiple criteria for the same condition, and define the logic that determines whether your AI Agent serves the content for this condition or if it moves on to the next condition.
Example:
account_type variable’s value is equal to “gold”; the country variable’s value is equal to “Canada”).account_type variable’s value is equal to “silver”; the account_type variable’s value is equal to “gold”).Choose a variable to use as a basis of comparison. There’s no limit to the number of variables you can use.
Choose an operator. The comparison operators available vary depending on the type of variable you chose in step b; for more information, see Comparison operators.
If the operator you chose compares the variable to a value, configure that value. To the right of the Value field, click the Options button
and choose your field options. Then, enter a value to check against the variable’s value.
Word, your AI Agent wouldn’t accept word, WORD, or wOrd as matches.To add additional criteria, click the Add button
and repeat steps ii-iv.
Under the condition you just made, drag and drop blocks that you want those customers to see.
You can’t drag and drop Conditional blocks into a Conditional block, because they’re designed to contain other blocks instead of being contained. If you need more complex logic in your AI Agent, contact your Ada team for assistance.
To add additional conditions, click the Add Condition button
and repeat steps a - b. Additional conditions are indicated with the
symbol.
Lastly, it’s a good idea to set up an else condition, so customers who don’t meet any of your conditions still see content. The action is indicated with the
symbol. For this condition, all you have to do is drag content blocks in. You don’t have to set up this condition, but it’s useful as a best practice.
Comparison operators are logic statements that tell the Conditional block to match customer information that’s captured in the variable you’re using. The available operators vary based on the variable type you’re using: