Conversational AI
  • Introduction
  • Getting started
    • Getting started
    • Adding content to your bot
    • Capture information with entities
    • Capture information with input validation
    • Reusing intents with context
    • Flow navigation with variables
    • Adding new users to your account
  • Understanding users
    • Natural Language Processing (NLP)
      • NLP threshold
      • NLP Import & Export
      • Train your bot with actual user messages
      • NLP Dashboard & NLP Improve
      • Synonym entities
      • System entities
      • Supported languages
      • Intent templates
    • Expression generator
    • Context
    • Multi-language bots
  • Bot answers
    • Bot dialogs
      • Message components
      • Go To
      • Input Validation
      • Action
      • Translations
    • Conversations
    • Analytics
      • User flow
    • Publishing your bot
    • Events
    • Reuse flows
    • Settings
      • Variables
  • Integrations
    • API integration
      • Advanced API integrations
    • Chat message structure for API's
    • Retrieving data from Airtable (GET)
    • Sending data to Airtable (POST)
    • Human handover & live chat
      • #Interact
      • RingCentral Engage Digital
      • Genesys Cloud
      • Help Scout
      • Zendesk Chat
      • Intercom
      • Sparkcentral (beta)
      • Offloading Webhook
  • Channels
    • Channels
    • Facebook Messenger
      • Facebook Admin Removal
      • Facebook Webview Whitelisting
    • WhatsApp Business API
    • Google Assistant
    • Webhook Channel API
    • Chat widget
    • Phone & voice
    • Workplace from Facebook
    • Sinch Conversation API (beta)
  • Tips & Best practices
    • How to NLP
    • Creating diverse expressions
    • Why is my bot not responding the way I want it to?
    • What makes a good chatbot?
    • How to recognize a returning bot user
    • Gathering user feedback
    • Using time in your chatbot
Powered by GitBook
On this page

Was this helpful?

  1. Tips & Best practices

Gathering user feedback

PreviousHow to recognize a returning bot userNextUsing time in your chatbot

Last updated 4 years ago

Was this helpful?

This tutorial will teach you how to gather feedback from your users about the quality of the bot and send that feedback to an external database for further analysis. In this example we will send the feedback data to Airtable.

  • Start by creating a flow in your Chatlayer.ai bot that contains rating options, for example:

  • Make sure you save the rating of the user as a variable "star_rating" with a number value

  • As a Go To, create a new input validation called "long text feedback"

  • Save the additional comments under the "comment" variable, and Go To a newly created Action "send feedback to Airtable"

  • In the newly created Action, add a "Code" plugin that contains the following header:

  • The "nextDialogState" is where your bot will go after saving the feedback to Airtable

  • Create a new Airtable with these columns:

  • Add the following code to your Code plugin in Chatlayer.ai

const body = {
    "records": [{
        "fields": {
            "star_rating": args.star_rating,
            "comment": args.comment,
            "sessionId": args.sessionId
        }
    }]
}
const airtableResult = await fetch('https://api.airtable.com/v0/(insert app name here)/(insert table name here)', {
    method: 'POST',
    body: JSON.stringify(body),
    headers: {
        'Authorization': 'Bearer (insert your bearer token here)',
        'Content-Type': 'application/json'
    }
}).then(r => r.json())

ChatlayerResponseBuilder()
    .setNextDialogState(args.nextDialogState)
    .send()
  • Add a small confirmation to the "feedback recorded" bot dialog

  • Ready to test!

  • The feedback data from the user shows up in the Airtable, ready for analysis!

In this tutorial, we will be using . Feel free to reuse it!

Remember to get the right app id, table name and bearer token for your Airtable. You can find it .

this Airtable
here