Setting the dialog result
During the conversation with the client, it may be necessary to record the dialog result. Based on such results, you will be able to identify script weaknesses and fix them, as well as estimate conversion rates.
Aimylogic provides the $analytics.setSessionResult
method that allows you to set dialog results. You can track them in project statistics.
How to use
Identify the key points of your script and set them via $analytics.setSessionResult
in the Code block.
The method accepts a string surrounded by single or double quotes.
Usage details
-
If
$analytics.setSessionResult
was called more than once during one session, only the last result will be recorded. -
You can use the method for both chatbots and call campaigns.
Where can I see dialog results
The dialog result will appear on the chart in Statistics → Results as soon as the client enters the script section where the result is set.
Example
Let’s create a script in which the bot requests feedback from the client.
- Create a screen with the Text block and insert “Please, help us improve our bot! Did you find everything you were looking for?”.
- Add the Yes and No buttons to the screen.
- Create another screen with the Code block and call the
$analytics.setSessionResult
method. Pass the Positive feedback string as the argument. - Add the Text block to this screen and paste “Thanks for your feedback. We are happy to help you!”.
- Connect the Yes button with this screen.
- Repeat the steps 3−4. This time, pass Negative feedback into
$analytics.setSessionResult
, and paste “We are really sorry that couldn’t help you. How can we improve our service?” in the Text block. - Connect the No button with this screen.
- To catch any client phrase, add the global
$TEXT
intent to this screen. - Create one more screen with the Text block and paste “Thanks! We will take your feedback into account.”.
- Connect the global intent to this screen.
You will get the script as follows:
Positive feedback or Negative feedback will be displayed in the Results chart, depending on the button chosen.