$analytics.setMessageLabel
The method sets labels to client phrases.
Syntax
The method accepts two arguments:
Argument | Type | Description | Required |
---|---|---|---|
labelName | String | The label name in a group | Yes |
groupName | String | The name of labels group | No |
$analytics.setMessageLabel("labelName", "groupName")
The label set to a particular phrase will be displayed in the Analytics > Dialogs section and in the phrases report.
Usage details
- Before adding a label, you need to create it in the interface. To do this, click in the upper right corner of the screen and navigate to Label catalog > Phrase 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
state: Help
a: How can I help you?
state: Return
intent: /returnPurchase
script:
$analytics.setMessageLabel("Returning purchase", "Question category")
$reactions.answer("What is your order number?")
# ...