How to Build a Facebook Chatbot to Generate Leads

Discover how to use a facebook chatbot for automated lead qualification and contact collection, saving time and reducing ad costs with this innovative approach.

Clock Icon
8 minutes
Calendar Icon
9/9/19
Person Icon
Guillaume Heintz
Summary
Summary
Down Arrow
Share this article
Looking for more leads ?
Link Icon

Right now, everyone’s talking about chatbots. Whether during the Facebook F8 or in the closing keynote at SMX Paris, chatbots are proving to be an extremely popular topic of conversation among digital marketers. Take a look at the Google Trends statistics for the term “chatbot facebook”.

Despite their popularity, chatbots are still in the beginning stages of development, and few are profitable.But we like new innovations at Dolead, which is why we decided to try creating a lead generation process using Messenger.

We started with a simple concept: we would create a chatbot to automatically qualify leads. If the lead meets the criteria that we are looking for, we’ll ask for his or her contact information. Once we have this information, we’ll send it to a Google Spreadsheet or to our CRM.

Finding customers to interact with our bot is also simple. This can be done via a Facebook Ads campaign, which is generally less expensive than Google Ads.

As our campaigns have not yet run for a long enough time, I won’t get into discussing our bots’ average ROI. But what I can tell you is that it works, and that we’ve collected a fair amount of leads for a low ad spend. Why not give it a try?

Why Should I Create a Chatbot?

If you advertise on Facebook ads, you’re sure to be familiar with these two styles of ad campaigns:

• “Website” campaigns, to bring people to your landing page• “Lead generation” campaigns, with an integrated form on Facebook

Note that most Facebook traffic now comes from mobile devices, and it can be extremely difficult to fill in a form on landing page using a mobile device, especially if the page already has a ton of content on it. As for Lead Generation Forms on Facebook, they are fairly low quality. Their strength is their main weakness.

Let me explain: the fact that information from the user’s Facebook account is automatically filled into the form fields saves time for the customer. But often, the customer is not paying attention, and sends their information without intending to. Using this type of campaign for B2B should also be avoided, as users almost never sign up for Facebook using their professional e-mail address.

There’s also the option to run a Lead Generation campaign on LinkedIn, but these work only occasionally in France, and can be quite costly.

In a significant development, Facebook recently added a “Messages” option for Facebook Ads campaigns.

This option lets you redirect a user who has clicked on one of your ads to a Messenger chat. Originally implemented by Facebook to assist the customer service team, this feature was not originally intended for lead generation.

Then chatbots came along.

Replace customer service by a bot, and you can qualify leads 24/7.

Here are 4 tools that we’ve used to create our Chatbot and lead generation campaign

Facebook Ads – Messenger
Chatfuel: to create a bot for free
Zapier: to export leads from the bot
Google Spreadsheets: to store the leads

1/ Facebook Ads – Messenger

Your chatbot’s basic function is to automatically reply to messages sent to your page via Messenger.

However, the fact remains that most Facebook pages receive little initial traffic. This is why it’s a good idea to encourage users to visit your page via a Facebook Ads campaign.

This type of campaign is similar in structure to the classic “Click to access website” campaign, the only difference is that instead of sending users to a specific URL, you’ll send them to Messenger, by choosing “Messenger” as the destination.

Next, you have two options:

• Automatically send a message to users after they have clicked on the ad• Send an initial message in JSON format, which can include buttons or images

In our case, the chatbot will activate automatically, so the field can be left blank.

2/ Create a basic Chatbot using Chatfuel – no coding necessary

There are several different ways to create a chatbot for Messenger:

• Starting from scratch (well, with just the Messenger API). This takes a lot of time, and you’ll need to know how to code.• Using existing frameworks such as Microsoft Bot Framework, API.AI or WIT.AI. This is a bit faster, but you still need to write some code.• Using a platform like Chatfuel, which is completely free and allows you to create a bot using a simple drag-and-drop interface.

Chatfuel has a classic “SaaS freemium” model – you can create as many chatbots as you wish for free, as long as you don’t exceed 1 subscriber limit (or some other limitation, like messages sent per month).

Customer interaction is key to any successful business.  In the past, this often meant having a dedicated customer service team to answer questions and resolve issues. However, with the rise of chatbots, businesses can now automate many of these interactions, freeing up human customer service representatives for more complex tasks.

A/ Write the script for your chatbot

The first thing to do is to write down the script for the conversation that your bot will have with the customer. To do this, create a flowchart for your bot’s conversation, either on paper or using apps like draw.io.

As you can see here, the only objective of this bot is to generate leads for our product Dolead Campaign Manager. It therefore follows a pre-written script and does not have any “artificial intelligence”. If the user enters text that the bot does not recognize, it will simply send the user a default response.

The aim here is to create a Minimum Viable Product (MVP) for your chatbot: give it the essential features that you need, and it can be improved upon in the future.

B/ Enter your script into Chatfuel

We’re only going to use the “Build” feature here, which lets you enter pre-written conversation sequences. The “Setup AI” feature is used to create a (limited) artificial intelligence, while the “Broadcast” feature can send a message to all users, similar to a newsletter.

First, give your bot a name, and connect it to a Facebook page (preferably your company’s page). Now click on the bot, then on the “Build” menu. The bot has two required blocks:

• Welcome message: The first message that a new user will receive when interacting with the bot.• Default message: The message that the bot will use to reply to a sentence that it didn’t understand.

A Messenger bot created using Chatfuel is made up of blocks. Each block has a precise goal: Say hello, see if the user is interested in the offering, get information from leads, send the information to Zapier, etc.

These blocks consist of “cards” that represent a type of conversation or a specific action. You will usually use one card to write a message to a user, another to receive a reply, etc.

For this example, we’ll only be using the following cards:

• Text: to send text to the user.• Typing: to give the impression that the bot is typing a message. This may seem unnecessary, but it’s actually essential, as it “humanizes” the bot.• Quick Replies: to send pre-written replies to the user.• User Input: to ask the user a question and collect their answer.• Go to block: to move from one block to another if certain conditions are met.• JSON API: to send the information to Zapier.

C/ The Welcome block

Let’s start by customizing our chatbot’s “welcome message”. Here’s how I set up the Dolead bot: I included an introductory message to very briefly present the bot to the user, then a “Typing” card, followed by another text message asking the user about his or her interest in automizing AdWords campaigns. I then added two quick reply options, Yes/No.

If users answer “No”, they are sent to a “end of conversation” block. Answering “Yes” continues the conversation, sending the user to a block dedicated to collecting more information.

D/ Collecting lead contact information

The goal of this block is to ask for and collect the user’s contact information: their first and last name, e-mail address and telephone number.

To do this, we begin by telling the user that we are going to ask them for information, via a basic text card. We then add a “Typing” card (which I actually always include between two text cards), followed by a “User Input” card.

With this card, you can add as many questions as you need, depending on the information you’d like to request from the user. Enter the question in the text field on the left, and the name of the attribute that you are collecting on the right. This name will allow you to send the data to Zapier later. You can also add a validation field, to ensure that the user has entered information such as their telephone number or e-mail address.

Don’t forget to change the default content in the card. These will be used when the chatbot needs to ask the user to re-enter information in certain fields, such as in the “telephone number” field.

Finally, add a last “Go to block”, which will take the user to our final conversation block.

E/ Sending lead information to Zapier

It’s now time to send your new lead’s information to Zapier, which will then send it to a Google Spreadsheet (or to the CRM of your choice). Because chatbots cannot send information directly to a Spreadsheet or CRM, we need to use Zapier via webhook, as sending data via webhook is supported by Chatfuel.

Note that Chatfuel has recently added a “Zapier” card, but it appears to have a few bugs. For this reason, I recommend trying out this example with a JSON API card.

Add a “JSON API” card to the last block. Keep the request “type” as GET (POST works too, but it’s a bit more complicated to use).

In the URL field, copy and paste the webhook URL which Zapier will provide (we’ll get into more detail on that in the next section.) Next, add the lead attributes that you would like to send in “User Attributes”. Only enter the attributes that you have collected in the previous step. In any case, Chatfuel will display them again when you begin typing them, so you’ll be able to select them again.

3/ Create a Zap on Zapier to collect your leads

First things first, if you don’t yet know about Zapier, I highly recommend that you check it out! Zapier is a SaaS web application that lets you automate lots of different things: collecting leads from a webhook, copying appointments from Google Calendar to Todoist or a Hubspot contact to Trello, etc.

To collect our leads, we’ll first need to create a “Zap”. A Zap is made up of a series of tasks that Zapier will automatically run based on a series of pre-defined events. The free version of Zapier lets you use up to 5 Zaps for 100 tasks per month.

To begin, choose “Webhook” as the “Trigger” for your Zap (the task that will launch the Zap). Configure the webhook as a “Catch Hook”. This configuration is set up, by default, to expect a GET or POST request to the URL that Zapier will create for you. And remember, we’ve already configured Chatfuel to send GET requests!

Use the URL that Zapier provides you, and copy and paste it into Chatfuel’s JSON API card. This way, when Chatfuel sends a request to this URL, Zapier will receive it automatically.

Then click on “test” to try out your bot on Messenger. Enter some information, and when the conversation is finished, go back to Zapier. You should have received a confirmation of the test, with the information that you gave your chatbot a few seconds earlier.

Open a new tab and create a new Google Spreadsheet, with columns for the various different lead attributes, and save it on your Google account.

Now create a Google Spreadsheet action on Zapier and select your Google account. Then select the Spreadsheet that you have just created, and add each lead attribute to the corresponding row.

There you go! All you need to do now is confirm and launch your Zap. It will automatically update your Google Spreadsheet with the leads you receive via your bot.

Conclusion

You now have a chatbot that collects and sends leads to the Spreadsheet or CRM of your choice. Think about all of the advantages that this offers: you can collect leads 24/7, using a method that seems more natural to the user than a landing page. You can also benefit from the popularity of Facebook Messenger – the most installed app in the world, with more than 1.2 billion users!

If you’d like to see similar articles, browse our blog.

Quote Icon