Science & Technology

How to create a chatbot for Facebook

Facebook offers a chatbot service you can personalize for your business

FACEBOOK chatbot

How to create a chatbot for Facebook. Source:pixabay.com

The popularity of chatbots is growing all over the business landscape. In retail only, the implementation growth is enormous. The chatbot market was valued at $17.17B in 2019 and is projected to reach $102.29B by 2025. It is estimated that the global number of successful retail chatbot interactions will reach 22 billion by 2023, up from 2.6 billion in 2019. They speed up and refine customer service in a number of ways. Moreover, they help firms and organizations to redirect their funds into development and innovation, rather than maintaining costly daily operations. Juniper Research, an analyst house that focuses on digital technology trends and markets, has forecast that chatbots will be responsible for cost savings of over $8 billion per annum by 2022.

Many companies develop their own in-house chatbot solutions, while others rely on the existing paradigms. Thus, such an omnipresent social network as Facebook offers a chatbot service you can personalize for your business (like Wells Fargo did). Here is a step-by-step guide on how to create your own chatbot for Facebook Messenger.

Option 1: Facebook’s developer console

This way is clearly for people who have some coding experience. If you do, please, visit the introductory webpage to learn the ropes of Facebook Messenger for developers. If you don’t, please, skip all this abracadabra and proceed to option 2.

Find out how to create Facebook chatbot. Source: shutterstock.com

For the sake of the general public, we won’t load the article with code samples. You can find all the details here. In short, you have to:

  1. Create a Facebook page (if you haven’t already got one) that you’re going to automate with a bot
  2. Build a webhook starting code from scratch or get it from GitHub. If you do not have a server to deploy your webhook to, you can remix the starter webhook project on Glitch.
  3. Set up your Facebook App that will link your Facebook Page to your webhook.
  4. Generate a page access token in your app’s Messenger settings and copy the token to your clipboard.
  5. Save your page token as an environment variable. If you are using Glitch, set your environment variables in the provided .env file to ensure they are hidden from other Glitch users.
  6. Add your page and verify tokens to your webhook code.
  7. Stub out basic functions that will handle the incoming webhook event types you want to support, as well as responding via the send API.
  8. Get the sender’s page-scoped ID.
  9. Parse the webhook event type.
  10. Update the code to define the message payload of your response, then pass that payload to callSendAPI().
  11. Send a message with the Send API.
  12. Update the code to handle media attachments, allowing you to create media-rich experiences.
  13. Create a response with a structured generic template.
  14. Handle the messaging_postbacks webhook event that will be sent when the recipient taps one of the postback buttons in the generic template. This is useful when you want to invoke an action in your bot. You should receive a different text response for each button.
  15. If you’ve managed to do all that, wait for the moderators to deploy the chatbot to all users.

You can also create a chatbot for Workplace – work collaboration tool built from Facebook. It will automatically post content into groups, respond to questions with extra info, or take action when mentioned in comments on a post.

Option 2: Chatfuel

The photo transfer tool

Facebook chatbot can facilitate your business. Source: shutterstock.com

Chatfuel is the world’s leading AI chatbot platform for Facebook Messenger. Chatfuel bots require no coding on your side. These ready-made solutions can answer questions, recommend products, qualify leads, automate tasks, and perform other functions to benefit your brand. To create one:

  1. Log into Facebook. Make sure you have a social page for your business. Open Chatfuel in the same browser. Click the “get started for free” button on the Chatfuel homepage. Proceed to connect the Facebook page to Chatfuel.
  2. Check the tutorial and start the customization of your chatbot.
  3. Create your greeting message.
  4. Add a default response shown in case the user asks something that’s not in your AI database. It should have some navigation buttons suggesting possible matches. For example, “I’m not sure what you mean. Perhaps, you should check FAQs (where FAQs is a button linked to the relevant section).”
  5. For all recognizable conversation patterns, there are two types of navigation possible: simple phone-menu-like, and complex AI-driven. You can combine both types. For instance, give simple instruction buttons for basic operations and use AI to process complaints or complex service issues. If you aren’t ready for the full AI experience just yet, you can limit the bot’s functions and redirect customers to live consultants with a link/phone call button in any complex case.
  6. Set up the navigation. List the most common questions your customers may ask. Group them into topics. You should build a new “block” for each of these questions and title them.
  7. Link blocks to your welcome message and default answer. Click the “add button” option on the message block. Type in the button name — that’s what the user will see. Then, in the next section, select “block” you previously created. You can also link a button to a URL or phone number to dial.
  8. Create the block content. When you’ve created the path, fill the “block” with the needed information. Click on the block in the menu to add the content of the following types:
    • text card (simply add text here);
    • typing (text will appear in a simulation typing mode);
    • quick reply (text will show up as a short message, not a card);
    • image;
    • gallery (you can add a few pictures with titles, short descriptions, and links to your website);
    • go to block (redirection to another specific block or a small component of a conversational dialog);
    • to sequence (redirect to a new conversational sequence that usually contains many blocks);
    • + (add more functions). You can integrate your chatbot with other third-party apps or leverage more powerful options inside of Chatfuel.
  9. Set up AI. Find the same button on the left side of the menu. This is where you put in the different words or phrases you want the chatbot to watch for and link them to either the content you’ve already created or a new text response. There is a little drop-down where you can select “text” or “block”.
  10. Launch. Click on the “Promote” page in the left-hand navigation menu, and then copy the URL at the top of the page. Add this link to your website, Facebook page, or in your online ads.

Using Chatfuel may not require coding, but it will need some money if you wish to use the chatbot’s full potential. The free plan is limited to 50 monthly users. The full pricing policies can be found here.

Option 3: Dialogflow

Facebook

Facebook chatbots works on Messenger. Source: shutterstock.com

Dialogflow offers one of the best NLU (Natural Language Understanding) and context management. To create Facebook Messenger bot here, you’ll need:

Once you’ve got all the components, let’s start.

  1. Enable Facebook Messenger integration under the Integration tab in Dialogflow Console.
  2. Configure the integration. Copy the Callback URL to later configure the Facebook Messenger Webhook. Fill in Verify Token and Page Access Token, then click on the “START” button to activate the Dialogflow webhook for our agent.
  3. Configure the Facebook webhook for your app. Use the Callback URL and Verify Token values you copied above. Don’t forget to enable messages and messaging_postbacks.
  4. Add content:
  5. Test your app. Open your Facebook Page and click on “Add a Button”. Select “Send Message” and click Next. Select “Messenger” and click Finish. Mouse over the “Send Message” button and click on the “Test Button” option. Click on the “Get Started” button and you should receive the Welcome message of your Dialogflow agent.

Other options to create your Facebook chatbot

chatbot

Other options to create your Facebook chatbot. Source: shutterstock.com

There are many more different software solutions helping to start your chatbot journey.

ManyChat helps to automate & combine Facebook Messenger and SMS to grow your business. It has a little more functionality than Chatfuel and a little higher learning curve. You can opt-in for a template focused on your business or build your own bot from scratch.

Wit.ai  – the platform allows creating bots, mobile apps, smart home controls, and customize wearable devices. It helps business owners to train chatbots and apps. Thus, with the help of AI, they can understand what your users say and assign it to different intents.

Botsify uses drag-and-drop templates to create bots. They are capable of leading conversations in multiple languages and have a smooth human takeover transition.

Flow XO provides over 100 cloud-based integrations. These include both utility modules (like webhooks or email) as well as integrations with other 3rd party services such as Google Sheets.

SEE ALSO:

Pay Space

6691 Posts 0 Comments

Our editorial team delivers daily news and insights on the global payment industry, covering fintech innovations, worldwide payment methods, and modern payment options.