Tutorial: Integrate Dashbot into your Dialogflow Agent with Firebase Inline Editor in less than 3 minutes

Tutorial: Integrate Dashbot into your Dialogflow Agent with Firebase Inline Editor in less than 3 minutes

Google’s Dialogflow is one of the popular development tools used by chatbot builders to craft conversations for Google Assistants and various other platforms like Alexa, Slack, Facebook Messenger, or Twillio.

Many Dialogflow users choose to go with Cloud Functions for Firebase for the fulfillment of their Agent:  it is totally integrated to Dialogflow’s code editor and allows the agent to run serverless. 

Integrating Dashbot into your Dialogflow Agent is quick and pain free – for beginners and code wizards alike.  

Here’s how to manage a successful integration in less than 3 minutes.

Pre-requisites

Before integrating Dashbot to your Dialogflow Agent on Firebase, you must have: 

Easy 2-step process

1. In your Dashbot account, add the Agent to get its API key
Type in the agent name and select Google as the platform from the dropdown list.
The Category and Product Status are optional.
Click Register. This will open a new page on which you will find the API key that will be used to identify your agent when Dashbot and Firebase communicate.

2. In Dialogflow’s fulfillment menu, enable the Inline Editor

a. In the package.json tab, add Dashbot to the list of dependencies
Copy the line in blue and past it at the bottom of the dependencies list.

"dependencies": {
...
const "dashbot": "^10.4.2"
}

b. In the index.js tab

i. Define the Dashbot constant
Copy the following line in blue and paste below in your list of constants.
Replace the red text ‘DASHBOT_API_KEY’ with the API Key generated in Step 1 above. 

'use strict';
const functions = require ('firebase-functions');
const {dialogflow} = require ('actions-on-google');

const dashbot = require ('dashbot')('DASHBOT_API_KEY).google;

ii. After defining your Agent constant, pass the Agent object to the Dashbot handler
This will enable the data to be sent to Dashbot.
Make sure the name in brackets matches the name you gave to your agent.
By default, Dialogflow calls your Agent “agent.” If you wrote the code yourself in the Inline Editor, use the name you chose for your Agent. For example, if you called it “app,” it would look like this.

const app = dialogflow();
dashbot.configHandler(app);
...
// business logic
...
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);

Hit “Deploy” and that’s it!

These 3 lines of code are also available for an easy copy-paste:

Get instant confirmation on the success of your integration 

Send your Agent a test message. 
You can do so in Dialogflow by typing a message into the “Try it now” console in the upper right corner of the page. Alternatively you can open the simulator for the Action and send messages there.

Go to your Dashbot’s page. Click the “Verify” button to check if data is coming through. 

If the integration was successful, you will see the confirmation below:

If you see the message below, Dashbot is not yet receiving data from your Agent. 

Here are the most common reasons for this:

  • Your Agent has been inactive for too long. As suggested in the error message, send a message to your Agent and try again.
  • Webhook calls are not enabled for Fullfillment at the Intent level in Dialogflow. Go back to Dialogflow, scroll down each Intent page all the way to the Fulfillment section and enable the webhook call.

View your Reports

After successfully integrating Dashbot, check out your reports by clicking View Reports on the chatbot page, or by selecting the chatbot from the Bots/Skills drop down. 

Click the Real Time section in the left nav. From here, select any of the real-time options to see the data coming into your chatbot. 

Please note, some of the other, non-real-time reports in the dashboard are rolled up on time intervals. If you do not see data initially in those reports, check back in an hour to see them fill in.

For more information about our reports and to view samples, please check out our tour

Insider’s tip 

With Dashbot’s Unhandled Report, you can quickly see where the NLP is failing to understand the user, and use that information to retrain your bot on Dialogflow. 
Make sure you configure your Fallback Intent for this report to populate correctly.
By default, Dashbot calls this Fallback Intent “NotHandled.” By default, Dialogflow calls this Intent the “Default Fallback Intent.”

Go to your account page and click the settings button for the relevant bot. Once on the bot settings page, click the Edit button.
Next to “Not Handled Intent Name”, select from the dropdown list the Intent that corresponds to your Fallback Intent. Save and check out the reports.

Please note, if you do not see the Intent you want to use in the dropdown, wait 24 hours and check again. Our daily batch process populates the list with all of your Intents. 

Have any questions?

Need help with the integration? Want to know more about Dashbot? Let us know!

Are you developing with other tools or for other platforms? Please check out our Documentation for other integrations. 

About Dashbot

Dashbot is a conversational analytics platform that enables enterprises and developers to increase user engagement, acquisition, and conversions through actionable insights and tools.

In addition to traditional analytics like engagement and retention, we provide conversation specific metrics including NLP response effectiveness, sentiment analysis, conversational analytics, and the full chat session transcripts.

We also have tools to take action on the data, like our live person take over of chat sessions and push notifications for re-engagement.

We support Alexa, Google Home, Facebook Messenger, Slack, Twitter, Kik, SMS, web chat, and any other conversational interface.

Contact us for a demo

Close Menu