Facebook Messenger

🎥 Video Tutorial

Overview

In this section, we will dive deeper into the process of setting up a ChatGPT-powered chatbot or chat agent on Facebook Messenger. By the end of this section, you will have a clear understanding of how to:

  1. Automate responses to user messages:
  • Connect your Messenger business account to the SeaChat chatbot and agent platform.
  • Train the chatbot using ChatGPT’s advanced language model to generate natural language responses to a wide range of user queries.
  • Configure the chat agent to automatically respond to incoming messages based on your knowledge base.
  1. Access all conversations with users through SeaChat:
  • Use SeaChat, a user-friendly interface, to access and monitor all conversations between users and your chatbot.
  • Review chat transcripts, analyze user behavior, and identify areas for improvement in the chat agent’s responses.
  • Manage and organize conversations efficiently to ensure seamless communication with users.
  1. Enable users to request live agent assistance:
  • Implement a special command that allows users to request assistance from a real human agent if they have complex queries or require personalized support.
  • Seamlessly transfer conversations from the AI chat agent to live human agents, ensuring a smooth and efficient transition.
  • Empower users to choose the level of support they need, enhancing the overall customer experience.

By the end of this tutorial, you’ll have a SeaChat agent powered Facebook Messenger bot and also a SeaChat console to view all messages, as shown below:

SeaChat | Facebook Messenger Integration

ChatGPT-powered chatbot integration with Facebook Messenger using SeaChat


Before embarking on the setup process, it’s essential to keep in mind a few key points:

Messenger limitations:

  • The SeaChat AI agent is designed to respond to incoming messages only and cannot initiate conversations on its own.
  • However, you as the agent creator will still be able to talk with the users once a live human agent is requested.

Who benefits from this integration:

  • Businesses and organizations with a high volume of incoming Messenger messages that require automation.
  • Companies looking to provide personalized and engaging customer support experiences.
  • Customer service departments seeking to reduce the burden on human agents by automating routine inquiries.

Facebook Messenger Setup

Setting up Facebook Messenger can be a straightforward process with the right guidance. Here’s a short version of the steps involved. You can also click on the titles to see a more detailed explanation of each step:

  1. Create a Messenger App:
  • Go to the Meta Developer Site.
  • Click on My Apps in the top-right corner.
  • Select Create App from the dropdown menu.
  1. Choose App Type:
  • Choose Other under App Type.
  • Enter a unique app name, avoiding the use of Messenger App or Facebook in the name.
  1. Add Messenger Product:
  • Scroll down to the bottom of the app list.
  • Find Messenger and select it to add the product to your app.
  1. Configure Messenger Application:
  • Carefully review the information on the configuration page.
  • Follow the instructions to provide necessary details, such as business name, address, and contact information.
  • Ensure that all required fields are filled out correctly.
  1. Generate Access Token:
  • Once the configuration is complete, generate a permanent access token.
  • This token is essential for using the Messenger API.
  1. Remove Your Messenger Integration:
  • Properly remove the page access from your Meta app
  • Click the Remove button inside SeaChat

📚 Recommended Reading:

Remember to adhere to the Messenger API policies and guidelines to maintain compliance and avoid any potential issues.

The following is an elaborated explanation that walks you through the process step-by-step:

Create a Facebook Messenger App

You’ll first need to go to Meta Developer Site and create a new Facebook Messenger app by clicking My Apps in the top right corner, and then selecting Create App from the dropdown menu.

SeaChat | Messenger | Create New Messenger

Create a New Messenger

Choose App Type

Create an Other app because we’ll just use this App for accessing your Messenger account. On the Select app type page, select Business for the type, then click Next.


SeaChat | Messenger | Create Other App

Create an Other app


SeaChat | Messenger | Choose Business

Choose Business


Here we created an app called Seasalt.ai App, note that Meta doesn’t allow the app to have Facebook or Messenger in the name. Carefully read through warning messages when choosing the app name.


SeaChat | Messenger | Choose App Type

Create App


Add Messenger Product

After creating the App, let’s add the Messenger product. Find the Messenger box under the Add products to your app section, and click Set up to create your app.

SeaChat | Messenger | Add Messenger Products

Add Messenger to Your App

How to Configure Messenger Application

🚨 Warning 🚨

Here is where things get a bit more complicated. If you are not careful enough and miss a step, you might not be able to successfully configure your Messenger application. So, let’s carefully go through the following instruction together.

Step 1: Configure webhooks

Find Messenger API under Messenger on the left. From here we’ll first need to configure the Webhook and tokens provided by SeaChat.

SeaChat | Messenger | Configuration Step 1

Verify Token

Here is all you have to do. Go to SeaChat, navigate to Agent Configuration → Channels → Messenger to get the Callback URL and Verify token.

SeaChat | Messenger | Configuration Step 2

Navigate to Messenger on SeaChat

Copy SeaChat’s Step 1 and paste it to corresponding parts on Messenger dashboard.

SeaChat | Messenger | Configuration Step 3

Copy SeaChat info to configure


Paste the Callback URL and Verify token to the corresponding fields on the Messenger dashboard:

SeaChat | Messenger | Configuration Step 4

Paste the URL and token


After this, we’ll need to properly configure Webhook Fields to give the right permission to the webhook callback URL:

SeaChat | Messenger | Configuration Step 5

Webhook Fields configuration


Select messages and click Subscribe:

SeaChat | Messenger | Configuration Step 6

Subscribe selected messages


So your final configuration of webhook would look like this:

SeaChat | Messenger | Configuration Step 7

Webhook configuration


Step 2: Generate Access Token

The Meta app needs to access a certain Facebook Page to be able to receive messages sent from that Page. So in Step 2, you’ll first need to authorize it to access your public Facebook Page.

SeaChat | Messenger | Access Token Step 1

Generate Access Token


After authorizing with a Facebook Page, you can further Add Subscriptions:

SeaChat | Messenger | Access Token Step 2

Click on Add Subscription


Again, we want to subscribe to messages:

SeaChat | Messenger | Access Token Step 3

Choose messages


Finally, let’s generate the access token:

SeaChat | Messenger | Access Token Step 4

Token generation


Once the token is generated, we need to copy the token:

SeaChat | Messenger | Access Token Step 5

Token details


Paste it to Step 2 of SeaChat Messenger setup:

SeaChat | Messenger | Access Token Step 6

Paste Token to SeaChat


Now turn on your App Mode to be Live and you can chat with the bot:

SeaChat | Messenger | Access Token Step 7

Live mode


Step 3: Alternative to Complete App Review

So far your messenger bot will respond only to you, the app creator. If you pass it to others, they will not get a response at all. It might be tempting to do “Step 3. Complete App Review” per Facebook’s instructions:

SeaChat | Messenger | App Review Step 1

App review


However, It might take up to 5 days to complete the App Review and the process is very cumbersome. For instance, it requires you to take a video walkthrough of the Meta app.

An alternative way is to assign the page to the business you have with Meta. To do so, go to Meta Business Suite, select the business your Meta app was created under, and then go to AccountsPages, and make sure that the Facebook Page your chatbot is connected to is there:

SeaChat | Messenger | Facebook Pages

Make sure the Facebook Page shows up under your business


You should now be all set!

Engage with a real human agent

Did you notice in the above picture that I used /live_agent to request a human agent? If an agent happened to be online by setting their online status:

SeaChat | Messenger | Live Agent Status

Live agent status


They can directly talk with the user!

SeaChat | Messenger | Live Agent interaction Example

Live agent interaction


If an agent is not online, they can turn on Email notification to receive real-time emails when a user initiates a chat, or request a live agent:

SeaChat | Messenger | Live Agent Preference

Live agent preference


Remove your Messenger Integration

If you want to remove the Messenger integration, you need to do it in two places:

  1. Properly remove the page access from your Meta app
  2. Click the Remove button inside SeaChat

For Step 1, please go to your Meta Business appMessengerMessenger API SettingsGenerate access tokens → remove

SeaChat | Messenger | Remove App

Remove integration


Respond to Voice Clips

Do you know that SeaChat supports audio messages too? If a user sends a voice clip, SeaChat can transcribe it to text, and respond via text!

Currently, it supports English speech to transcription, but let us know if you want more languages supported.

SeaChat | Messenger | Messenger Voice Clip

Facebook Messenger voice clip transcription and response by SeaChat


Messages Postback on Messenger

Once you have set up your Messenger integration, you will be able to interact with your customers using the button feature of SeaChat. This allows you to add urls or additional information to your answers in the form of buttons.

To activate, simply go on the page of Edit Page Subscription on Messenger.

SeaChat | Messenger | Edit Page Postback Feature

Enable Postback on Edit Page Subscription


Button limits on Messenger

After following the above steps, you can now use the button feature on SeaChat integrated with Messenger. However, since we are still using the API provided by Messenger, there are some limitations to keep in mind when creating your buttons to avoid any issues.

The following are the limitations:

  • The button template allows up to 3 postback buttons per message template.
  • Each button can have a payload of up to 1000 characters, which is sent back to your webhook when clicked.
  • The button title is limited to 20 characters.
  • These limits apply to each individual button, so you can have 3 buttons per message, each with its own 1000-character payload and 20-character title.
  • Developer Documentation

A good solution to reduce the effect of these limitations is to use SeaChat’s KB ID feature. Please check out the link for more information.

🎯 Troubleshooting

If you have not received responses from SeaChat Agent on Messenger, you should verify the following easily missed settings:

  • Has your Messenger application been set to Live mode? Be sure that it is not operating in Development mode.
  • Did you configure the webhook fields to allow the message permission? If this permission is not properly granted, SeaChat will be unable to receive messages from messenger.

Support

Need assistance? Contact us at seachat@seasalt.ai.