Table of Contents

Build a WhatsApp Bot - Best Practices and User guide

Elisa Updated by Elisa

Prefer watching than reading? No problem, we've got you covered 👇

How to Create a WhatsApp bot

To create a WhatsApp bot, click on the "Build a chatbot" option of your dashboard and select WhatsApp:

Once you select the WhatsApp bot will see that you can use our Build it for me feature, start from scratch (a new bot) or use a WhatsApp bot Template.

Once you have finished building your bot you can test it on your mobile device using the Test this bot feature.
For more information on how to test your WhatsApp bot, please check this article 🚀

Best Practices to build WhatsApp bots

Reply Buttons block (WhatsApp)

The Reply Buttons block lets you add clickable buttons in your WhatsApp bot, making it easier for users to respond quickly and saving them time and effort.

Before using the Reply Buttons block, please keep in mind that:

  1. You can only add 3 buttons.
  2. Hyperlinks are not allowed.
  3. Users cannot select more than one option at the same time from the button message, but they can go back and re-open a previous message.
  4. The maximum number of characters in the button text must be 17, if the limit is passed, the block is not displayed in the flow.

Keyword Options block - Assign keywords to buttons

With the Keyword Options block, you can assign multiple keywords to the button, so that the user can write any of the keywords or the corresponding number of the chosen option:

For more information about how the Keyword Options block works, please refer to this article.

Message sequence

When using Messages, the best practice is to:

  1. Add Text and Media in independent blocks:
  1. As a rule of thumb DO NOT have more than 2 message blocks without user input.

Capture the first user's input and use it to redirect the flow

Unlike Web bots, in WhatsApp, it is not mandatory to start the flow requesting an input from the user.

You can directly capture the first user's message and use it within your bot, or even redirect the flow depending on what the user has texted!

To capture the first user's input, you should start your flow with a Collect Intent block.

For more information about capturing the first user's input, please refer to this article.

Direct a user through a different bot flow on their Second Visit

If you capture the first user's input, as explained above, you can also use it to direct a user through a different bot flow on their second visit!

All you need to do is to add a Conditions block where we will verify if this is the user's first time interacting with the bot with a field that would have been set in the first interaction with the bot.

For a detailed explanation, please refer to this article.

Global Keywords

As WhatsApp has a fixed text input field, the users can type anything at any point in the bot flow.

To take advantage of that, you can use the Global Keywords block, and assign keywords that will be captured and triggered at any point in the bot flow.

For example, if the user type "Agent" at any point in the flow, you can interrupt the flow and direct them to a flow containing a Human Takeover block.

Please check this article for more information about how to use this feature.

Types of Content Supported:

You can send different types of content to your users, but please keep in mind that due to WhatsApp's user interface, not all features are displayed as they are in Web bots.

Please see this article to check how the kind of content or media you will send/receive is supported by our WhatsApp bots.

Features Compatibility with WhatsApp

Please keep in mind that some of the features available for Web bots are not fully compatible with WhatsApp bots - even if it possible to find them in your WhatsApp bot builder.

For a full list of compatibility of our features with WhatsApp, please check this article 😎 🚀

Session and fields

If you are not familiar with the concept of fields, please check this article.
  • A field can be set.
  • A field's value can be changed within the flow or at the conversation in the Chats section (by your Human Chat Agents)
  • A field can be unset.
  • A value remains in the WhatsApp session, and will be overwritten if the user answers the same question with a different answer.
  • WhatsApp automatically captures the name and phone number of the users, which are saved in fields by default. You can check or reuse these values at any time, using the fields @name and @phone.

Loops are banned

Loops without user input are not supported in the bot builder and cannot be created.

Loops are only allowed when a user input is part of the loop.

Interacting with Users

Contact users within 24h from their last contact with your bot

Once users have started a conversation with your WhatsApp bot, you can contact them through the Chats section without any limitations within a 24-hour window, counted from the last message sent by the user.

However, due to WhatsApp's policies to prevent spamming, after this 24-hour period you will need the user's authorization to contact them proactively (Opt-in).

If these 24h have passed, your messages in the Chats section will not be delivered.

If the users have Opted in, you can contact them proactively using templates pre-approved by WhatsApp (Message Templates).

Please check this article to learn more about the Opt-in, and this article to learn more about the Message Templates and how to request them.

Make sure to get the User's authorization (Opt-in) to be contacted

If the 24-hour window from the first contact has passed, you can only contact users proactively if they have given their consent.

This means only clients who have opted in can be reached.

For those users, you can send messages using WhatsApp-approved Message Templates.

Please check this article to learn more about the Opt-in.

Reach out to users using Templates and Campaigns

To contact proactively users that have made the Opt-in, you must restart the conversation by sending Message Templates, which must be approved by WhatsApp.

You can send Message Templates individually within a conversation in the Chats section, or for multiple users at the Campaigns section.

Please check this article to learn more about the Message Templates and how to request them.

Use Call-to-action buttons in your Message Templates

Create an interactive template to reach out to your users on WhatsApp proactively, while also giving them the option to click a button to call you or visit your website.

Please check this article to learn more about the Message Templates and how to add a call to action to it

Just Human Takeover?

If you just want to use your WhatsApp number to have your Human Chat Agents answering chats, you can create a bot specific for that, with a simple flow leading to the Human Takeover block.

Please check this article to learn more about the Human Takeover block, and this article to learn more about the Chats section.

One bot at a time (Parent bot x New Parent Bot x Campaign bots)

You must link a "main bot" to your WhatsApp number, which we call a Parent bot.

New Parent Bot:

If you change the Parent bot, the flow of the parent bot in conversations already started will not break.

The Parent bot will end first, and then the new Parent bot will start.

Bot Linked to Opt-in:

If you connect a bot to a Snippet for the Opt in, it will interrupt the flow of the Parent Bot.

Bot Linked to Opt-in or Campaign:

If you launch a Campaign with a bot, it will interrupt the flow of the Parent Bot.

Please check this article to learn more about the Parent Bot, and this article to learn more about Campaigns.

Add a Click-to-WhatsApp to your Web bot

It is possible to add an option to your Web bot allowing users to send a message to your WhatsApp with a click 😎

You get the link in this option in your Growth tools:

Analyze Metrics and Data

Check the Metrics section

The data belongs to the same WhatsApp Channel (each number), not the bot.

The best practice to manage all the data related to a WhatsApp number is to use the Metrics section of your Landbot Account.

Choose the channel of the WhatsApp number you want to review, and you’ll be able to see all the data linked to that number.

If you want to see the data specific from one specific bot that is active in a WhatsApp number, you can also check the Analyze Section of that bot, where you’ll find both the Metrics and Flow Analytics tabs.

Keep in mind that this section won’t show the information stored at the channel level or collected by other bots using the same WhatsApp number. This is why the data in Analyze > Users won’t appear, and must be checked from your account’s Metrics section instead.

If you’ve used the Custom Goals feature, the Goals metrics are available under the Analyze > Metrics section of your bot.

WhatsApp Testing

If you’re not yet using the official WhatsApp API integration, you can test your bot using the Test this bot feature. This lets you try out the full experience on your own WhatsApp number.

Please check out this article to learn more about WhatsApp Testing

If you’re on a trial or WhatsApp Plan, and already have the WhatsApp Official integration with an approved number, you can link your bot to that channel and start testing live immediately.

Please check out this article to know how to link a bot to your WhatsApp channel

Was this article helpful?

WhatsApp Testing

Build a WhatsApp Bot - Best Practices for Developers

Contact