How to build a Facebook Messenger chatbot

Everything you need to know on how to create a chatbot on Facebook Messenger, the unique Messenger benefits you can tap into, and step-by-step instructions on how to build your own chatbot with no coding knowledge required.

Senior Content Marketing Specialist

Dave Hitchins

Senior Content Marketing Specialist

Facebook Messenger is a wildly popular messaging app in Meta’s stable of communication tools. In 2023 it boasted 931 million active users globally, and is the most popular messaging app in many countries, including the United States where it has 130 million active users.
Many businesses also use Messenger very effectively to communicate with customers and prospects.


With the ease of building sophisticated chatbots, introducing a Messenger chatbot is a great way to connect with more people, provide better and more efficient customer service, and drive more leads.


In this blog we cover everything you need to know to plan, design, and build the most effective Messenger chatbot for the use cases that you have in mind.

Remember, you don’t have to be a developer to build a Messenger chatbot. Using a simple drag-and-drop interface anyone can follow our step-by-step instructions to build a useful working chatbot for free and with no obligation.

130 million

The number of active Messenger users in the United States, making it the most popular messaging app in the country.

78.4%

The proportion of Facebook’s global mobile audience that also uses Messenger.

300,000

The number of chatbots active on Facebook Messenger at any one time.

What is a Messenger chatbot?

A Messenger bot is a software tool created in order to automate communication between a business and users of the Facebook Messenger app.

Ranging in sophistication from a simple guided experience that enables users to choose the answers they are looking for, to a more conversational style of chatbot that uses more natural human language. In both cases, the communication is facilitated via the interface of the Messenger app.

What are the business benefits of introducing a Messenger chatbot?

With so many other channels available to businesses to deploy chatbots on, what makes Messenger such a compelling option?

An instant global audience: Globally there are approximately 2.9 billion individual people active on Facebook every month. No other platform provides the same potential audience. Facebook is often one of the first places that a person will reach out to a brand.


Low start up overhead: Most businesses already have a Facebook Business Page. If they don’t, they are extremely quick and easy to set up. Once you have created your Messenger chatbot, it can simply be added to the page.


Easily accessible on both mobile and desktop: Some people may only use a mobile to access Messenger, some may access it through Facebook on their desktop machine. Most people probably do both. With a Messenger chatbot it doesn’t matter – the experience for the user is the same. Importantly, your Messenger chatbot will work on all platforms that Messenger is supported on – including iOS, Android, and web devices.


Easy integrations: Messenger is provided by the tech giant Meta, who also provide Facebook, Instagram and WhatsApp. The products can therefore be easily integrated to extend the customer base that can be reached. Meta is also investing heavily across their product suite in new features and AI to improve the experience for business audiences.


One-click conversations: One of the most important benefits of Messenger is that it enables people to start a conversation with your brand with just one click. With most people permanently logged into Facebook on their phones, they just need to open the app, find your page, and click the chat button. Compare this with the multiple clicks and devices involved in searching for a phone number and then dialing it manually.


Marketing integrations: With Meta’s extensive range of social media apps, it has created a powerful ‘walled garden’ which businesses can benefit from for marketing purposes. By deploying a chatbot on Messenger it can be easily integrated into campaigns and digital adverts. For example, when a person enquires about a product on Messenger you can display a carousel of product images and include an ‘Add to Cart’ or ‘Show Associated Products’ buttons. You can even run entire campaigns just using Facebook Messenger chatbots.


Advanced analytics: With a long pedigree in social media, Meta provides unparalleled tools and analytics to help businesses find new customers, provide a better experience, and improve ROI by targeting people most likely to be interested in their offering. A Messenger chatbot can also be a powerful tool for gathering feedback directly from customers and enhancing the business’ customer data platform with zero-party data.

What types of chatbot does Messenger support?

Messenger supports all types of chatbot and can be used to cover most if not all a business’ chatbot use cases. He we include a summary of the main types of chatbot that can be deployed on Messenger and the use cases that they are ideally suited to.

Rule-based Messenger chatbots

These chatbots follow a pre-configured decision-tree structure to enable people to find the answer they are looking for via a set of options. You could think of them as the digital equivalent of an automated phone system where the caller selects a series of numbered options to be connected to the correct department.


Rule-based chatbots are the quickest and easiest to set up but can be incredibly useful for answering day-to-day queries that customers may previously have had to speak to an agent to find an answer to. Anything from store opening hours, product availability, and account balances can be provided via a simple set of options displayed in a Messenger chat window. Messenger’s native features can be used to enhance the experience by including buttons, images, and videos.

Intent-based or conversational Messenger chatbots

These are more sophisticated chatbots that can be designed to provide a more conversational experience for people interacting with them. They take longer to build as they use natural language processing (NLP) and need to be ‘trained’ to understand multiple words, phrases and intents. However, once this has been done, they can closely mimic the experience of talking to another person on the Messenger app and can answer a much wider variety of questions.

How to build a Messenger chatbot in 6 simple steps

The following example uses Infobip’s no-code chatbot builder Answers. You can get access by signing up for a free trial which will enable you to follow the steps and create your own working Messenger chatbot. Note that you will only be able to test your chatbot using the Simulator, but to actually deploy your chatbot you will need to get in touch with one of our account executives who will talk you through the process.

Step 1 – Get familiar with the chatbot builder interface

The Answers interface has been designed to be simple and intuitive enough for anyone to be able to build a chatbot for Facebook Messenger.


However, before getting started it is worth familiarizing yourself with the layout of the screen and a few key concepts.


The chatbot flow is built up in a series of steps by dragging elements from the side panel onto the workspace. These elements are organized into three categories based on the function that they perform.

  • Bot Sends
  • Bot Receives
  • Bot Actions

The process for using these elements is always the same:

  1. Find the element you want to use and drag it onto the workspace
  2. Configure it in the side panel
  3. Link it into the chat flow using the options on screen

Step 2 – Add a welcome message and configure a fallback option

Start by greeting people that have initiated a conversation with your chatbot. Keep it open as initially you won’t know why they have got in touch i.e. what their intent is.

  1. Drag and drop an Attribute element onto your workspace.
  2. Add some suitable welcome text and maybe a question to start learning about their intent. Remember that any information that a person provides can be stored and used throughout the chat. From their name to identifying information like account number or postcode. This enables a better experience for the person as they won’t have to keep repeating information.
  3. Add fallback options to handle occasions when the chatbot is unable to process the person’s input – maybe because English is not their primary language, or because they are using a device with a non-standard keyboard. Cleverly worded Repeat and Fallback options can be used to provide a more seamless experience.

Step 3 – Create menu options for users to select

Now it is time to find out what the person’s intent actually is. This is done by providing a list of options for them to choose from, each of which can have an action associated with them, including displaying a subset of options so that the chatbot can answer more complex queries.


Add a Send Text dialogue that asks the person to select from the list of options that we will configure in the next step.

Next, you need to link the introductory text to the list of options by adding a Go To Dialog element and then a Text element to provide an explanation of the options and the text for each option in the list.


To provide a more natural experience it is recommended to use the Delay option to provide time for the person to digest the text you are displaying and make a decision on what they would like to do.


You’ll find the delay option under Bot Actions. If you are displaying more text, then extend the delay by an extra second or two.

Now we need to specify the list of options that the person will select from.

We do this by adding a User Input element from the Bot Receives menu. This will process the response that the person replies with.


The simplest, quickest, and most unambiguous approach is to provide a list of numbers that the person simply has to enter to select their desired response. You can also add Synonyms if you want to provide more descriptive text.

Step 4 – Link responses to actions

Now we need to configure an Action and associate it with each of the options that are available for the person to choose.


You can do this using a Go To Dialog for each option.


Remember that Facebook Messenger supports lots of options for making chatbot interactions more fun and engaging. For example, you can use image carousels and videos to make your responses more useful.

  • If your customer requests the address of their nearest store, you can send them the physical address and the exact geolocation using the Location attribute.
  • If a user requests information about a product or general information about your company, send them a suitable video.

Simply drag the relevant element onto the workspace and link or upload the media you want to include.

Step 5 – Create an exit path for the chat interaction

Creating a seamless exit from the chat leaves a good last impression and ties up the interaction so that it isn’t left in limbo.


Once you have confirmed that the person has achieved their intent, you can close the chat or loop them back to the initial menu of options in case they have another query.

The last step in the build process is to reset the chatbot with a Close session attribute. This can be configured to purge any data retained during the interaction, or to copy it to the customer data platform.

Step 6 – Testing

Testing is a critical stage in the creation of an effective chatbot. Our chatbot building tool includes a Simulation option that can be used to thoroughly test every intersection in your chatbot before you deploy it.


As it replicates the real-world experience of interacting with the chatbot, you will also have the chance to check that the Delays that you configured are optimal, and that there aren’t any dead ends in the chat flow that you might have missed.


We always recommend getting other people to try out new chatbots before you deploy them as new eyes will sometimes find inconsistencies that the creator missed.

When building a chatbot to put unto production, the final step to deploy your chatbot is to simply click the Activate button and it will be live and available to your customers.

This is an example of a simple but highly effective rule-based chatbot that can add a great deal of value to your business with minimal time and expense to create. If you would like to see some of the more advanced features that you can add to your chatbot, have a watch of this video which covers what we have demonstrated above, and goes on to cover additional options.


More complicated chatbots that use Natural Language Processing (NLP) to understand the intent of the person interacting with them and to respond conversationally are more time consuming to build, train and test.


They can be created using the same interface and same methodology as the one we have just demonstrated, but there is the additional requirement to train the chatbot with a large number of intents so that it is able to replicate a more human conversation.


It is worth covering how this works so that you understand the entire process before you start building an intent-based chatbot for Messenger.

Creating an intent-based chatbot for Facebook Messenger

Quickly and effectively working out the intent of a person is the key to any successful chatbot. As we have demonstrated, with rule-based Messenger chatbot the designer provides a list of options for the person to choose from. If there is not an option that matches their intent – then the chatbot can’t help them other than connecting them with a human agent.


Conversational chatbots have the potential to be far more flexible, with the backend logic covering far more intents than could be effectively displayed in a list.


Recognizing the intent and then knowing which service or conversation flow to activate at a particular point is the key to a successful conversational chatbot.


Let’s demonstrate this using an example of a person getting in touch with their bank to check how much money they have in their account.


The chatbot flow would look something like this:

  • The person starts off the chat with the request “What is my account balance”.
  • The chatbot’s NLP engine scans the text and after discarding non-relevant words such as ‘what’ and ‘my’ identifies that it needs to trigger an intent for “account balance”.
  • This then triggers the pre-programmed flow for ‘account balance’, which may involve an API integration with the banking system to retrieve the required information.
  • The chatbot will then use this information to formulate a reply like “Your account balance is: $5,500.00”.

The success of this interaction depends on the chatbot being able to differentiate the intent “account balance” from similar but different intents such as “account details” or “account history”.


To be able to consistently do this, the AI engine behind the Messenger chatbot must be trained to recognize multiple versions of every intent that it is designed to understand.


Even for simple intents you may need at least 50 different versions of each intent phrase in order to effectively train the AI. For more complex intents the number could be over 400.


To cover the required scope of a conversational chatbot, you may need tens of thousands or even hundreds of thousands of training phrases. Many brands that have deployed conversational chatbots successfully have used third parties that specialize in providing all the training phrases required.

Facebook Messenger chatbot FAQs

Can I connect my Messenger chatbot to WhatsApp?

Unfortunately, as Messenger and WhatsApp each have their own unique underlying architecture, it is not a case of simply plugging your Messenger chatbot into WhatsApp.

However, with the ease of creating chatbots in Infobip’s Answers it would be much easier to replicate your chatbot for many other channels, including WhatsApp, Viber, and Telegram. If you have built an NLP chatbot, you would also be able to re-use intents and training phrases.

Does Meta have to approve my Messenger chatbot?

As long as your chatbot doesn’t break Meta’s policies and regulations for Messenger, you do not have to submit it for their approval before going live.

Can I build a conversational chatbot for Messenger?

Absolutely. As we have discussed above, you can build an AI chatbot for Messenger that uses Natural Language Processing (NLP) to understand customer intent and respond in an appropriate conversational style.

How do people find my Messenger chatbot?

There are lots of options for helping people to find and interact with your chatbot. Some options that you may wish to consider include:

  • Add a Messenger chat link to your Facebook Business page, your company website, and the footer of your emails.
  • Use paid Facebook ads that include an option to open a chat. These ads can be extended to other Meta channels like Instagram.
  • Include QR codes on product packaging and outdoor media which open a Messenger chat when they are scanned.
  • Use free PR channels like Facebook Stories, Instagram Reels or Threads, or go the paid route with press articles or collaborations with influencers in your industry sector.
  • Submit your chatbot to Facebook’s Discover tab which enables Facebook users to find it based on keywords and categorization.

Sign up to create your own Messenger chatbot

Sign up
Sep 20th, 2023
13 min read
Senior Content Marketing Specialist

Dave Hitchins

Senior Content Marketing Specialist

Related content