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.

Note that we are not talking about is Facebook comment auto-replies. This is a completely different use case where automatic replies are set up for positive or negative comments made by people on a brand’s public Facebook posts. This is a problematic use case as it is difficult to accurately gauge the intent of a comment and respond appropriately. People do not like templated replies that may come across as dismissive.

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.

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.

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.

Facebook Messenger chatbot examples

A lot of Facebook users spend more time on the app than they like to admit. Help to make this time as productive as possible by deploying Messenger chatbots to help with all sorts of everyday queries and tasks.

Answering FAQs

Most of the questions your business gets on social media are probably the same ones repeated over and over. A chatbot can easily be trained to answer these, with the option to hand over to a human member of staff for more complex questions.

Order tracking

People are impatient when it comes to receiving the goodies that they have ordered online. Deploy a chatbot on Facebook that can provide order updates and hyper-accurate delivery information.

Booking appointments

A Messenger chatbot that is integrated with your appointment calendar allows people to easily select slots that are convenient for them. Go a step further and offer to send a reminder closer to the time, and any information they might need to know prior to the appointment, like parking information or what they need to bring with them.

Request feedback and reviews

Good Facebook reviews generate trust and lead to more sales. Use a Facebook chatbot to request reviews when a person reaches out on the platform about a positive experience or purchase.

Onboarding customers

Chatbots are being used increasingly to guide customers through the onboarding process. As a social channel, Facebook is ideal for two-way conversations that help customers to get to grips with new technology and processes, or simply to help them complete a task from renewing a subscription to checking into their accommodation.

Health assistants

A growing trend is to deploy chatbots to support the work of health professionals by guiding patients through their medical journey. Health assistants can provide information about medication, allow people to check symptoms, and remind them to take medication and book appointments. For Messenger users, a medical chatbot can play a role in significantly improving health outcomes.

Sales support

Unless you are a large global business you won’t have staff on hand 24/7 to provide support to people looking to make a purchase. This can lead to missed sales and lower revenues. Chatbots can be deployed to answer questions from potential customers whatever the time of day or night, maximizing opportunities that might otherwise have been lost.

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
Jun 28th, 2024
14 min read
Senior Content Marketing Specialist

Dave Hitchins

Senior Content Marketing Specialist