When you have integrated a chatbot to your Facebook Messenger, the bot will handle all of the inquiries from your end users, and as a result, all inquiries will automatically be stored in the Done folder in Facebook. This can be problematic if your end user needs help from a human agent, and it’s therefore important to create a takeover process between the bot and the human agent. By doing a human takeover you will allow your human agents to take control of conversations in either Facebook’s panel or through a third-party app, so the bot remains silent unless the human agent returns the conversation back to the bot.
Preparing your Facebook account for human takeover
There are some cases when the bot should take the end user to another Facebook app or to the Facebook page inbox, so a human can takeover.
To do so, you will need to go to the listed apps linked to your Facebook page in the Messenger Platform page. Here you will need to make sure that Certainly is integrated with your Facebook site. This is automatically done when you integrate your chatbot on the Certainly Platform. Facebook will automatically list the Page Inbox app at the bottom of the list, as an app that may receive traffic as any other third-party app. Make sure that the Certainly app is the primary receiver, and any other app is set as a secondary receiver. In this way, the bot will work as first-line support.
If you don't have any other app and want your human agents to interact with your bot’s users through Page Inbox, select "Page Inbox" as the secondary receiver.
Setting up your bot for a human takeover
To be able to takeover a conversation from your bot, you can have a module in your chatbot, which asks whether or not the end user wants to be handed over to a human agent. If the end user says yes, you should send them to a module, where you can ask end users to confirm their choice. In the connection of this module, you should create a connection where there's a condition which accepts some sort of user input, as this will trigger the webhook. You should also add two types of action to the connection: add the following webhook and also add where the user should be sent to after this module. This webhook ensures that the conversation gets handed over to the secondary receiver on your Facebook page:
https://app.certainly.io/fbbot/api/passcontrol/? target_app_id=<secondary app id> &metadata=<string_to_pass_to_the_secondary_app_at_the_time_of_handover>
In the webhook, there are two parameters.
The first parameter is <secondary app="" id="">. This can be found on the Messenger Platform site under the Apps section and should be a string of numbers.
The second parameter is <string_to_pass_to_the_secondary_app_at_the_time_of_handover> and this is just a label, which can indicate to your human agents what the subject is about. Please be aware that spaces are not allowed, so either use ‘_’ or an encoder for this message.
Both parameters are optional. If target_app_id parameter is not present, control will go to the Page Inbox app by default.