Build a Chatbot for your Website with Dialogflow

How to Build a Dialogflow Chatbot

In this article we're going to show you how to use Dialogflow to build your first chatbot for your website.  With our live chat integration with Dialogflow, you can easily create a website chatbot to use in conjunction with your human agents to provide great customer support.

Our chatbot built with Dialogflow's natural language processing gives you powerful features to create just about any type of chatbot you want.  You can easily add our chatbots to your website to power your customer service.

Build a chatbot for your website

Here are some ways you can use our chatbots for your business:

  • Create a Chatbot powered Live Chat widget that leverages AI with no humans or agents needed.
  • Use your chatbot to only interact with your visitors when your live chat agents are offline
  • Have your chatbot answer missed chats that your agents haven't been able to respond to.
  • Have your chatbot join all chats in conjunction with your agents to help answer common questions.
  • Have your chatbot answer first, then drop out of the conversation once a human answers.

Best of all, our chatbots require no coding and are super simple to set up.

Here's a step by step guide to creating your first chatbot with Dialogflow and Social Intents

Prerequisites

High Level Steps

In this tutorial we're going to walk through the steps of adding chatbot functionality to your live chat that you can deploy on your website today.  Here are the steps:

  1. Create a Live Chat app in Social Intents
  2. Create a Dialogflow Agent
  3. Add your Dialogflow integration to your Social Intents account.
  4. Test out your new Live Chat app with chatbot capabilities!

1. Create a Live Chat app in Social Intents

If you don't already have an account with us, you can register for a 2 week free trial here.

If you use either Slack or Microsoft Teams, you can add our app right to each of these platforms so you can chat from the communications tools you already use.

After creating your Social Intents account, we'll generate a code snippet for you. You can copy and paste this code snippet into your website in order to enable your chat widget on your own site.  

2.  Create your Dialogflow Agent

Next, head over to https://www.dialogflow.com and login with your Google account.  Dialogflow is a natural language processing solution that uses Agents and Intents to respond to questions.  It supports many different messaging and voice platforms so you can create a single agent for your live chat and your other channels.


In this tutorial we'll create a test Agent that you'll integrate with Social Intents.  

Create an Agent in Dialogflow

After logging in, select the Create Agent button as in the screen below.

Your new agent will have 2 default intents.  These will be enough to get started and respond with generic welcome messages.  As you get more familiar with Dialogflow, you can create multiple Intents and Contexts to answer questions, gather answer data, and respond with Cards, Images, and Buttons.

Here are some sample phrases that our new chatbot will respond to in your live chat.

Our chatbot supports all response types from Dialogflow.  So if you want to respond with Cards, Images, Suggestions, or more in Dialogflow you can create a Slack, Google Assistant, or Telegram response type and we'll use these as well as the Text responses when responding to questions.  

Keep in mind, since we do use all responses to your Intents from these different apps, make sure to avoid duplicate answers like having the same response in Slack and Google Assistant since we would display both of them.

Set up Dialogflow Authentication for API access

Next, set up your authentication details and generate a Dialogflow Service Account Key you will use to integrate with your chat widget.  

If you click on the settings icon next to your new agent, you'll see the screen below.  Click on the link to your Service Account highlighted below.

Click on the Service account as below or you can create a new one:

Once you're on your Service account details page, click the Edit icon at the top of the page to put you in edit mode.  Then select 'Create Key' to generate your Private Key JSON file that will be used for our integration.

Choose JSON as your Key type and select.  This will download your private key to your computer.

You'll now upload this private's Key to your chat widget Chatbot page to enable our Social Intents integration with Dialogflow.

3. Add your Dialogflow Integrations Key to Social Intents

Now that you have created a Live Chat app and your new Dialogflow agent and key file, connect your Social Intents account to Dialogflow by logging into Social Intents, selecting My Apps from the left navigation bar, then Edit Settings on your Live Chat widget.  You can create a new widget if you don't have a Live Chat app yet created.

From the chat settings page, select the Chat bot tab at the top of the page.

Select the Chatbot name that visitors will see when your chatbot responds, select the language you've used in creating your Agent in Dialogflow, and choose your Chatbot type.

Lastly, upload the .JSON key file that you downloaded in the previous step by Choosing the File and clicking the Upload Dialogflow Private Key button.  This tells our app how to connect to the Dialogflow agent for answering your visitor questions when the chatbot is

4.  That's it!  You're ready to deploy your new chatbot

You're now all configured and ready to test your chatbot.  Simply login to our website, select your Live Chat app and choose Preview.  If you've already added the code snippet to your website, you can chat right there