$analytics.setSessionLabel
The method sets labels to dialogs.
Syntax
The method accepts a string which determines a label name.
$analytics.setSessionLabel("Label")
The label set to a particular dialog will be displayed in the Analytics > Dialogs section and in the dialogs report.
Usage details
- Before adding a label, you need to create it in the interface. To do this, click in the right upper corner of the screen and navigate to Label catalog > Session labels.
caution
If you pass a label which you did not add to the interface earlier, then this label will not be added.
- If the label is disabled in the interface, it will still be added to the report.
- If there are several labels with the same name, then all such labels will be added.
How to use
Labels can be used to highlight meaningful steps in a client’s pathway through the script.
In the example script below, the bot asks if the client wants to continue proceeding with an order.
state: ProceedOrder
a: We noticed that you haven’t finished your order. Would you like to continue?
state: No
q: No
script:
$analytics.setSessionLabel("Refuse to finish order")
# ...