Lesson 5: Make Your Bot Smarter And More Flexible

Estimated reading time: 20 minutes

In the previous lesson, you have learned how to create a chatbot to collect leads and orders for Monoco Shop. But in some cases, your customers don't follow the design Flow and ask random questions which may stop the conversation. And you want to make our Monoco Shop become smarter to handle these cases but still have a natural tone to enhance customer experiences.

That’s the reason why, in this lesson, you will learn to make the bot's conversation smoothly with the Keyword and Dialogflow feature. Next, We will guide you on how to add livechat option inside the bot with Human Takeover. You can also send follow-up messages to customers using Campaign. Finally, we will give you some tips to make the bot's content more attractive.

In this lesson, you will know how to:

Get started with Campaign

Have you ever think about launching a marketing campaign to reach out to more customers? Automatically deliver a series of messages with helpful content or task reminders to customers via a Messenger bot? If your answer is yes, the Campaign feature would be a great option.

Let's take a look at the Campaign we have created in our Monoco Shop chatbot to promote our winter collection for an overview. Go to Bot Builder > Drip Campaigns. You will see two parts, the part above are BotStar's Campaign templates, the below part is our Fashion Store Campaign to notify our customers of the latest products called Winter Promotion.

Click on the Winter promotion text, you will see messages within the Campaign. With this setup, after 12 hours the first Campaign message will be sent to the customer.

Note: The difference between Campaign and Broadcast is the time will the messages sent.

  • The broadcast will send messages to all customers at the same time even if that person has just interacted with the bot.
  • Campaign will send the message to the customer base on the time when customers go through the Campaign action in the Flow Editor to count the sending time.

Set up Winter Campaign

Now, you have known what Campaign looks like, let's head back to the main Campaign page and begin to create a new campaign that is the same as that. You can go ahead and delete the example Winter promotion if you want. You can do that by clicking the gray trash can icon on the right side of the bar.

To set up a "Winter promotion" for Monoco Shop, please follow these steps:

1. Head up to the purple +New Campaign button and click it to create a new Campaign of your own. Let rename it into Winter promotion

2. Click on the gray pencil icon to edit the message content, it can be either Custom Message

Or Use An Existing Block inside our Flow Editor.

3. Choose the Content Type for message outside 24 hours, it is recommended that you choose Content Type to get rid of Facebook banned messages due to Facebook’s 24-hour policy.

4. Create other Campaign messages by clicking + Message and edit the content just like the Example Campaign earlier.

5. After creating the whole Campaign content that we need, Let set up the Timeframe for each one. You can set it into Immediately, Minutes, Hours, Days

6. Click the Active button to enable or disable the messages you want to send customers.

Ways to use Campaign

After setting up the Winter promotion, there are two ways to add customers to it:

Automatically add your customers to a campaign

You can set up Campaign into Flow Editor by using the Action called Add to Campaign so that after customers go through that action, they will start receiving Campaign message. You can do that by following these steps:

1. Drag action Add to Campaign from Library panel into Flow Editor. Meanwhile, we change the action's name into Winter promotion

2. Add the Winter promotion we have created in the Subscribe to Sequence section

3. Connect the action with send operator order info and Module exit block so that after customers go through that part, they will start to receive the first campaign after 12 hours just like we have planned.

Manually add your customers to a campaign

To manually add customers to your Campaign means you can select and add customers by yourself, please follow these steps below to have a clear view:

1. Go to the sidebar on the top side of the page and navigate to Reports & Insights > Audience

2. Tick at the box of the customer that you want to add campaign to. You can also select/deselect all if you want. Choose the Bulk Actions > Subscribe to Campaign

3. Choose Winter promotion Campaign, the one we have already created at the previous steps.

4. Finally, you've already set up the Campaign for your chatbot successfully. Here is the result of using our Campaign:

Note:

  • Campaign is only available for Messenger only.
  • Customer will only receive the next Campaign message if customers respond to the previous Campaign message.
  • Please read our document about Facebook Policies for more details before sending messages that is outside 24 hours.

Answer random message with Keyword feature

After learning about Set default response in lesson 2, you have known how to take the user back to the bot's flow when customers type some random text that interrupts the flow for Monoco Shop chatbot. But if the user always receives the same response, and their question still can't be solved, we may lose our potential customers.

In that case, the Keyword feature would be a good solution. Keyword can recognize users' messages base on the keywords that appear in the message, then give them suitable responses. You can also give customers some information that doesn’t exist in the flow.

To set up Keyword, we need to go to Bot Builder > Keywords, then please follow these steps:

1. Understand your customers by knowing what kind of questions, demands, needs that customers usually ask our Shop. So we will use Existing Chat Logs and FAQ Resources to discover the most recent common questions to define user’s needs. Let's assume that the most common words that customers use are:

  • buy, shopping and the response we should give them is guide them to Choose Category block.
  • contact and the response we should give them Hi, what do you want to ask us? message.

2. Create a Keyword set by clicking the + New Keyword Set purple button above or New Keyword Set purple button below.

Let's name our Keyword Set is List Product

3. Click the purple + New Keyword button to create Keyword

4. Set up Keyword rule and response is to set the condition for the word so that bot can understand what answer should a customer receive a base on the keyword and condition. It can be either Manually Text or Existing Block inside our Flow Editor.

Note: For more information about Keyword, please visit our Keyword documentary

Activate personal chat with Human

After setting up Default response, Keyword, our Monoco Shop Chatbot still can't handle all of the questions, then we need to have an option that customers can contact a shop assistant to solve their problems effectively. In this case, you may use our Human Takeover feature.

There are three ways to enable Human Takeover, such as:

  • Use Human Takeover action in the Flow Editor through the user's request.
  • Manually switch on Human Takeover from BotStar Inbox.
  • Automatically switch on via some conditions defined in Bot Configuration, synchronized with Facebook Page Inbox.

But in this lesson we will guide you the first way is Use Human Takeover action in the Flow Editor through user's request like the design flow we have done at the beginning.

To set up Human Takeover in the Flow Editor, you can follow these instructions:

1. Drag Action Let Human Takeover from Library panel into Flow Editor to create an action. Meanwhile, create connectors from another block to action Let Human Takeover and change its name to Chat with staff

2. Click the Chat with staff action

3. Edit the Action Configuration when you want your bot to send a notification via Email when customers request to chat with staff

4. Edit Action Message so your bot will give out goodbye message and welcome message when users want to get back to bot's flow

5. After setting up human takeover, to enhance customers’ experiences, you always have to let customers have an option to chat with a person in case the answers they are looking for can't even be answered by Keyword. So we would recommend you should create connectors between Chat with staff with Fallback Block, Main Menu, Bot Menu, Module Shopping.

Note:

  • A useful tip for you when designing bot flow is that you should give your customers the right to chat with human proactively whenever they need a human assistant.
  • You can activate Human Takeover notification via Facebook through Bot Builder > Publishing Configuration > Messenger > Notification > Enable "Human Takeover Notification via Messenger Inbox.
  • For more information about other ways, you can visit our Human Takeover document.

Collect order smartly with Dialogflow

With keywords, your bots would be able to answer any random questions from customers. But you want your bot to be smarter that can help you collect orders smartly without having too many steps in our Monoco Shop Dialogflow feature would be a great option.

There are two stages that we will go through to set it up:

Note: For more information to understand Dialogflow better? Please visit Dialogflow official website

To set up a basic Dialogflow from scratch, please follow the below instructions:

Create an Agent

1. Head to Bot Builder > Integrations > Turn the Dialogflow on > Click Connect button

2. Create a new Agent called Monoco-Fashin-Store in Dialogflow

3. Define the Dialogflow entities - information that you want to collect from customers.

Based on the flow we have built for our Monoco Shop, there are 6 variables that you need to capture to start the ordering process which are Quantity, Delivery address, Delivery date, Product name, Size, and Delivery method. These 6 variables are called 6 entities in Dialogflow that we need to create.

However, these 6 entities are not all the same types. Some entities contain a list of products or services that we provide and we need customers to choose only from those options. For example, we have Yellow T-shirt, Green Skirt, Blue Jeans, Red Dress,... as the items that customers can select. These entities are called Custom entities and they are created in the Entities section in step 4.

With the entities that don't have a predefined list like the Custom entities and they have a lot of scenarios that can happen based on customer's input is called System entities and they can be created directly in the Intent section in step 6. For example:

Bot: How many items do you want to order?

Customer: 4 (or 2; 3; 5)

According to the explanation above, we can clarify our entities into two types like this:

Type of EntitiesEntities
System entitiesQuantity, Delivery address, and Delivery date
Custom entitiesProduct's name, Size, and Delivery method

4. Go to the Entities section and create the Custom entities as mentioned in step 3 like this:

  • Product's name

  • Size

  • Delivery method

5. Go to the Intent section, click the CREATE INTENT button and create Order.clothes intent

6. Prepare some training phrases that you think customers might type in the Training Phrases section.

When you enter a training phrase, Dialogflow will help you identify the entities you have created above. However, in some cases, if Dialogflow can’t identify the entities, then you can manually define them including the custom entities and the system entities.

For example, you enter the phrase: I’d like 2 small white t-shirts delivered to 123 ABC street on November 2nd. Then Dialogflow will help you define some entities like this:

You can always change the Entity as you want inside the training phrases. In this example, we will change the System Entity @sys.date-time into @sys.date to match our needs.

change date entity

Now, let’s define the other System Entities Quantity and Delivery address in this sentence.

defined system entities

The more training phrases you add to the bot, the smarter it becomes to identify your customer inputs.

7. In the Order.clothes intent, go to Action and parameters section and you will see all the entities you have defined in the training phrases:

Now, let's edit these entity data to match with our needs

8. Adding Some confirmation text in the Responses section. This sentence will be used when Dialogflow has collected all of the information. In this case, I will have bot confirm the order information before going to the next block.

9. Go back to the Intent Section, Click Add follow up intent at the Order.clothes intent's right corner, then click Yes and No to create these follow up intent.

After this, whenever you go to the Order.clothes intent, you will see that those follow-up intents have automatically added to your Context section.

Set up Dialogflow in BotStar

1. Go back to our Monoco Shop Chatbot on BotStar and select the Monoco-Fashion-Store agent we have created as the steps above.

2. Create a module named Dialogflow and connect it with the block Choose Product

3. Set up Order block like the picture below:

According to the mini-course flow, we will need to use the customer’s answer to confirm their order. Therefore, after filling all the fields above, go to User Response Handling to enable Expect User Response and create a confirm order block like in the Next Step. Only after that bot will store the customer’s input collected by Dialogflow into BotStar's variable.

4. Create a confirm order block.

In this block setup, you have to change the Intent Validation to order.clothes-yes and fill in the Conversation context. This action will help Dialogflow match the right intent.

Enter exactly the contexts of Order.clothes intent which is Orderclothes-followup for this setting.

At this point, the Dialogflow will give out the confirmation text which we have set up in Dialogflow step 8. The bot will have two outputs:

  • If the bot receives the answer Yes (or any other words with the same meaning), you will need to connect Completed button to the Yes Module Outlet.
  • If the bot doesn't get the right answer from the user to proceed with the order, (user may type in No or any other words that the agent isn't capable of recognizing), then you will create connection between Failed button to the No Module Outlet.

Please see the picture below for the setup.

After that, connect Yes Module Outlet to Choose Category block and connect No Module Outlet to Customer Information module

5. Test the result

Note:

  • For more information about Dialogflow, please visit our documentary.
  • If your Dialogflow shows the error message in Confirmation block after you have set up the Dialogflow for the first time, then please go the the "Order" dialogflow block > choose another intent > choose the intent "Order.clothes" again > set them up again. It will work this time.

Tips to enhance bot's content

After setting up all the features that can make your bot smarter. But you feel the Monoco Shop still has a machine tone and lack of personality. So you want to improve its tone to make it more natural and attract customers more during the conversation. Here are some tips that we think can help you, which are:

Personalized Greeting & welcome message

You have been introduced to what is First-Time Greeting Message and Welcome message in lesson 2. So you know those are the first message as well as the first impression user will receive when they first approach your bot. You have also learned what is user attribute and how to set up the User Attribute in lesson 4.

The tip is to use user attributes in Greeting & Welcome message's content. In our Monoco Fashion Store, by adding your customer's first name in the message, it will become more personalized as if this message is sent only to them. The Welcome message could be written like this:

We could do the same with Greeting message:

Now the bot will give out the customer's name in the Greeting & Welcome message. Here is the result we could get:

Greeting message

Welcome message

Different messages in the same block

To make our Monoco Fashion Store more natural by giving out different messages in the same block, we can activate the Random text. According to our Monoco Store's flow, we can sense that customers will go through the block Main Menu the most, so we will enable the Random text in block Main Menu . We will set up it like this.

1. Click the Main Menu block's message content.

2. Tick the box to enable random text.

3. Click + Add Random Text button to add many as random texts as you want.

Here is the result:

We can do the same with Fallback Block

Create a personality for bot

To extend bot's visual functionality and create a more engaging experience for your customers cause users love these chatbot images, stickers, and animated GIFs. So your Monoco Shop chatbot will become a more memorable and branded experience.

For example, at the end of the conversation in our bot flow, we have the Thank you block which contains the message "Thanks {full_name} for shopping with Monoco Fashion Store. Your order has been submitted! Our staff will contact you shortly 😉 ". But if we add an animated gif, the goodbye message that customers will receive would be more memorable. You could see the different:


You can also put any images you like into the bot to make it more colorful as well as replace a long informative text.


The final one is using icons in the message content to make our chatbot become more natural, so customers feel like they are talking to a real staff. Here is an example with and without icons in our Monoco Shop message content.


Some useful tips:

  • You can find many gifs at https://giphy.com/
  • You can minimize the image size but still keep the quality so that your Chatbot can run smoothly even if they were run in the out of date device using https://tinypng.com/

Set up typing time

In our Monoco Fashion Shop, there are some blocks that have long text such as Fallback Block, Confirmation Block, Direction,...So it would be more natural if you can make your customers see an indicator that shows bot is processing the request (like the one displayed when a person is typing).

Depending on your need, you can also adjust the typing time of each block. Go to Bot Builder > Settings > Behaviors > Typing Indicator > Enable it on

Congratulation! You have successfully made a smart bot with a natural voice tone that can enhance your customers' experience 😉 .

Moving to the next lesson, you will learn how to integrate your bot into your business effectively.

If you have any concerns, please feel free to leave a comment below or contact us through support@botstar.com. For more details on how we have helped our customers grow their business, you can view our use cases, blogs or join our BotStar community to learn and share new things 😊


Did you find it helpful?   Yes   No