Creating a custom filter to send a message just once

Sometimes you may want a bot to send out a specific message (e.g. a discount code) only once to a particular visitor, but none of the current conditions matches your scenario. In this case, the best way is to ‘label’ the person with a Custom Contact Property and use it as a filter later on.

A good example would be sending a discount code to a user who abandoned the cart, but has not made a purchase yet (i.e. if the client already bought something – don’t send him the discount code when he/she abandons the cart on the next purchase). There are of course other variations available too, covered at the end of the article.

How to create such bot

The first step is creating a custom contact property, this will be custom information you can save about your clients (so it can be used not only in bots but during a conversation as well, it’s basically like adding a new field on the visitor details panel on the right side). For the sake of the example, we’ll create a property called: “Has Purchased”

You can do it via Settings > Contact Properties

Set the type to text, as we’ll be storing a ‘plain text’ information in it.

The next step is making the bots assign that property with a value in it once someone makes a purchase. This one can be done via the Chatbots section, by setting a ‘Visitor opens a specific page’ trigger and specifying the address of the ‘Thank you, your order has been completed’ page.

If the URL there is dynamic, set just a part of it, e.g. /order-completed/ and select ‘Contains’ in the trigger’s settings. Once that’s done, connect the action called ‘Set Contact Property’ and use the previously created ‘Has Purchased” property, and make the action assign a ‘Yes’ value to it

The logic behind this: if the person reaches the page where the order is done, the chat will assign a Has Purchased: Yes info to that person, in this particular form:

Now, head over to the Abandoned Cart bot and at the very beginning of it (just after the trigger), add a ‘Based on Contact Property’ condition, use the ‘Has Purchased’ one with the ‘Yes’ value and connect the condition with a NO leg to the rest of the bot:

The logic behind this: if the person doesn’t have a ‘Has Purchased : ​Yes’ information set on him/her – the bot will move on according to the setup and send the discount code.

Other possible scenarios to use the ‘Based on Contact Property’ filter

Not sending an automatic message when the visitor has contacted you

If you’d like a specific message not fire when someone has already contacted you, you can set a ‘mark’ on that person by using ‘Operator doesn’t take the conversation’ which sets a custom contact property indicating that the person has reached out to you

Once that’s set, you can use the ‘Based on contact property’ condition to make the message or bot not fire if the person was in touch earlier

Multiple bots using the same message

If you have different bots that send the same exact message, but you want it to be sent just once, you can mark a visitor with a property ‘Message received’ and set up each bot to first check if the person got the specific message already, and if not – send it to him/her

The ‘Set Contact Property’ action should then add the label to the person

If you have any issues with setting up such chatbots, please reach out to us at [email protected] or use the chat in the bottom-right corner of our website.

Can't find what you're looking for?