Creating a Salesforce Einstein Bot for Facebook Messenger - TUTORIAL - JSON Viewer

Creating a Salesforce Einstein Bot for Facebook Messenger – TUTORIAL

The success of any business/company boils down to how good its Customer Support is. Especially in this day and age where most people prefer to use Chat Support, the replies must be quick and help the user as much as possible. However, a Support Agent might not always be available 24/7 and even if they are, there are still chances that some messages might not get noticed on busy working days. This is sure to leave the customer feeling unhappy and that’s the last thing any business wants.

To circumvent that companies like Salesforce have created something called Einstein Bot, it is an Entirely Customizable Chat Bot that allows for automatic instant replies to any user at any point in time. And the best part is that it supports a Wide Variety of Messaging Channels, from Facebook Messenger to Whatsapp to any other social media platform that you can think of.

And that’s exactly what we’ll be doing today, we’ll have a look at how to create your very own Salesforce Einstein Chatbot and integrate it with Facebook Messenger.

What is Salesforce & What does CRM Mean?

salesforce crm logo

If you don’t know what Salesforce does or what a CRM is, to put it simply a CRM ( or Customer Relationship Management ) is a tool for managing all the interactions/relationships with the potential / existing customers of your business/product

Why even need a CRM in the first place when you can directly interact with your customers?

That’s true, but imagine having more than 10, 20, or even 100 customers, sooner or later you will realize that it’s not so bad to use some help. And that’s exactly what CRMs do, they help you by storing the details of all of the customers  And allow a really easy & quick interface so that you can focus directly on the customers instead of worrying about the communication medium. A good CRM also provides you with other details about the customer such as their previous orders, their likes, and dislikes, any issues that they might be facing, etc. Seeing all of this data in a single place can allow you to gain extremely accurate insights into what exactly the customer needs

Salesforce vs other CRMs

salesforce and other CRMs on the market

This might not be a surprise, but salesforce isn’t the only CRM company out there. There are tons of other CRM Competitors, and the more the choices – the harder it is to choose. So let’s have a look at how each of them compares to one another.

Popularity & Reputation

market share of top crm software - pie chart

It’s important that the CRM Company that we choose is going to be around for as long as we need it to, and won’t just decide to shut down one day. That’s why we need to choose a company that is popular and has a good reputation among its clients. 

There is no question that Salesforce tops the list of popularity & reputation with its 33% share in the CRM World


pricing of top crm software - bar graph

Coming to the pricing, Salesforce might not be the best option if your company is in a position that doesn’t allow it to spend good amounts of money on a CRM. But don’t worry as there are tons of cheap options available that might suit your needs.

If you’re a Small / Medium sized company and are on a Budget then looking at companies such as Zoho, or  Hubspot CRM would be your best option, as they have almost all of the features that a good CRM is supposed to have, with a cheaper price.

Customer Support 

customer support image

There is no point in getting a CRM that you cannot use, quick tech support is very important for situations where you’re simply stuck and need a helping hand. Despite the size & requirements of your business, Salesforce is the clear winner here – with awesome tech support and 24/7 Live Chat, Email, or Phone availability, you just cannot go wrong by choosing salesforce.

The Final Messenger Bot – Demo

Before working on building the Salesforce Messenger Bot, let’s have a look at the final product so you can get a better idea of what to expect after you are done with the tutorial.

The below chatbot is for a Games Store, as of now it has three options 

  • Track My Order
  • Latest Game Available
  • Show Discount Coupons 

And if the user wishes for anything other than the above, or needs some help, the bot is smart enough to detect that and redirect the chat to a human support assistant

preview of the salesforce + facebook messenger integration

Step 1: Creating a Salesforce Developer Account 

The first step to creating a Salesforce Einstein Messenger Bot is to create a new Salesforce Developer account. This is because the Developer Edition of their platform offers most of the features ( including Messenger Bots ) completely free of charge ( for trial ) 

salesforce developer org signup page
  • Fill in the basic details ( First Name, Last Name, Email, etc ) and you should soon receive a Verification Email along with a login link
  • Follow the given link, enter your Email & Password and you should be welcomed with the Salesforce Dashboard as shown below
salesforce dashboard

Step 2: Setting up the Facebook Messenger Channel

For the Facebook Messenger bot to work, we need two things 

  • An actual bot that can reply intelligently ( Salesforce’s Einstein Bot )
  • A messaging channel for the bot ( can be Whatsapp, Facebook, etc ) 

In this step, we’ll be working on creating the messaging channel, and then in further steps, we’ll work on creating the Einstein Bot which will then be linked to this messaging channel 

To do that, 

  • Go to the Salesforce Dashboard and search for Messaging Settings in the Quick Search box
messaging settings salesforce
  • Click on the New Channel button to create a New Messaging Channel as shown below 
creating a new messaging channel salesforce
  • You’ll then be prompted to choose a Messaging Channel Type as shown, you can choose from a lot of different options ( Whatsapp, SMS, or Facebook Messenger ). But for this tutorial, we’ll be going ahead with the Facebook Messenger option
selecting a messaging channel type for salesforce
  • Selecting Facebook Messenger will now open a Facebook Login popup asking you to login into your Facebook Account to select the Facebook Page you want to add the messenger bot for 

Note:  You need to have admin/owner rights to the Facebook page for which the messenger channel is required. 

  • Select the Facebook page from the given options as shown below
connecting a facebook page to salesforce for messenger integration


connecting a facebook page to salesforce for messenger integration
  • The next step to do is to add a Chat Acknowledgement, this is like a Welcome Message that the channel shows if there is no support agent active currently.
writing a default chat acknowledgement for the messenger channel
  • The last step is to create a Messaging Queue, this is helpful if your company has multiple support agents that are good at a wide variety of things. This allows support requests to be redirected to the best support agent for that particular request.
creating a mesasging queue for a salesforce messaging channel

Step 3: Creating a New Salesforce Einstein Bot

The functionality in creating only a Messaging Channel is very limited as it only supports two features

  • Sending a Custom Welcome Message
  • Redirecting to a Support Agent using Messaging Queues

But most messaging bots these days can do much more without having an active support agent, they can display things like Current Offers, or even track orders. To add all of this functionality, we will need to create an Einstein Bot and link it with the Messenger Channel

To create a new Einstein Bot 

  • Visit the Salesforce Dashboard and click on Get Started With Einstein Bots button as shown below 
salesforce dashboard - einstein bots
  • To keep things simple in this tutorial, we’ll be creating a Standard Bot, as they are a good beginning point for people just getting started on Einstein Bots 
creating a standard einstein bot salesforce
  • In the next steps, we’ll personalize the Einstein Bot by giving it a name and setting the default language ( English )
personalizing salesforce einstein bot
  • Looking at the final chatbot, you can see a few buttons ( Track My Order, Latest Game Available, Discount Codes ) these are called Chatbot Actions, they perform custom actions when the user clicks a specified button
adding default greeting for the salesforce einstein bot
  • Follow the on-screen instructions for the remaining sections and voila! Your einstein bot should now be created.

Visit the Einstein Bots section from Quick Find and select the newly created Game Bot from the list of bots 

salesforce einstein bots list

You should then see a screen similar to the one shown below

salesforce einstein bot builder

Let’s first start by working on the Discount Codes section

The way that Einstein Bots work is by providing a chain of steps where each step can be one of the 4 things,

  • Message
  • Question
  • Action
  • Rules

For the Discount Codes section, we simply need to give the user a Custom Message with the list of currently active discount coupons 

Here are a few discount codes:

2) FREE50

To do that, we simply select the Message option and paste in the Discount Codes for the bot to display.

adding a message to salesforce einstein bot

Then, in the “next step” section, we click on Start Another Dialog: Main Menu so that the user is always redirected to the Main Menu after completing a Custom action

Similarly, we configure the Latest Game Available to show a Custom Message containing the Newly Released games in the store.

adding a message to salesforce einstein bot

Moving on to the last section “Track My Order”, here we’ll be asking a Question about storing the Order Number, then we’ll simply Transfer The Chat  to a Support Agent by sending a message “you are currently being transferred…

adding a question to salesforce einstein bot

Since the Order Number is an Integer/Number we use the following configuration for the Question Section

configuring the salesforce einstein bot

And that’s it! The Einstein Bot should now be created and functional, in the next step let’s look at how to integrate it into the Messenger Channel so that the users can chat with the Einstein Bot using Facebook Messenger

Step 4: Configuring the Salesforce Einstein Bot

Go to the Einstein Bot ( game bot ) that you created previously and navigate to the Overview Section

options for salesforce einstein bot builder

Then in the Connections Tab, you will see the following message

connections tab salesforce einstein bot builder

Click on the Add Connection button and fill up the resultant Pop up as shown below, to link the Einstein Bot to the Facebook Messenger channel created in the previous sections

adding a facebook messenger connection to salesforce einstein bot
  • And voila! The Einstein Bot should now be linked with Facebook Messenger, you can make sure that it works by visiting the Facebook Page and having a sample chat with it as shown in the demo


Congratulations on coming this far and completing this tutorial on creating a Salesforce Messenger Bot. Hopefully, this has been a good starting point on your journey of creating chatbots. There are multiple things you can try out next such as Integrating the Chatbot to your Website or try working on creating a Whatsapp / iMessage( SMS ) bot depending on what’s popular in your area. Einstein Bots are still in beta as of writing this article, so make sure to keep checking for new & exciting features that you find relevant to your product. If you found this article valuable and learned something new today, do share it with your friends