Skip to content

Dialogflow is Google's NLP offering. It supports a wide variety of European and Asian languages. This documentation focuses on how to integrate DialogFlow with Stackchat. To best understand how to use Dialogflow itself, read the full documentation.

Integration Scope

Dialogflow has many features, but Stackchat's integration with Dialogflow takes advantage of the following features only:

  • intent detection
  • entity extraction
  • sentiment analysis

Dialogflow Setup

In order to connect Dialogflow to Stackchat, you will first need to create a Dialogflow account and then a new Dialogflow Agent.

Create your Dialogflow account and click the arrow under the Dialogflow logo to create your first agent.

Dialogflow Create Agent

*The Dialogflow interface.*

Give your agent a name that matches your Stackchat bot's name for ease of understanding. Once your bot has been created, you can connect your Dialogflow agent to Stackchat using a Google Cloud Key ID that is unique to your Dialogflow model.

To find it, go to your agent settings and click next to where it says "Service Account" (or click the "+" button if there is no service account yet).

Dialogflow Service Account

*Stackchat requires the Dialogflow V2 API.*

Then follow these instructions from Dialogflow to start your service account.

In step 7, select the roles Dialogflow API Reader and Dialogflow API Client.

Stop after step 11.

Open the JSON file in a text editor and copy its entire contents to your clipboard and head to Stackchat.

Stackchat Setup

Select the bot you wish to add the Cloud Configuration to and select Integrations. Click Add Integration at the upper right.

Cloud Config Modal

*This modal shows all available Integrations.*

In the dialogue on the right, enter a name for your Dialogflow configuration and paste the contents of the Key ID JSON into the field labeled KEY ID and click Add..

Dialogflow Configuration Modal

*Make sure all JSON contents are included.*

Your bot is now linked to a Dialogflow NLP Agent. These steps will need to be repeated for each Dialogflow Agent you wish to use in your bots.

Enabling Sentiment Analysis in Dialogflow

If you're using our Adobe Analytics Cloud Configuration, you may wish to enable sentiment analysis in Dialogflow so that you can report on your audience's sentiment.

Sentiment analysis allows Natural Language Processing to attempt to determine the user's attitude during interaction with your chatbot, and this is currently a beta feature in Dialogflow.

To enable it, go to the settings in your NLP agent and locate the Enable Beta Features slider under the general tab.

Dialogflow Beta Features

*Move the slider on over.*

Once beta features are enabled, sentiment analysis data will be able to flow into Adobe Analytics and will appear in your Adobe Analytics Report Suite as Prop 11 (Sentiment Score), Prop 12 (Sentiment Magnitude), and Prop 24 (Sentiment Score Range).

At this time, there is no reason to enable this feature unless you are also using Adobe Analytics.