Skip to main content

$analytics.setMessageLabel

The method sets labels to client phrases.

Syntax

The method accepts two arguments:

ArgumentTypeDescriptionRequired
labelNameStringThe label name in a groupYes
groupNameStringThe name of labels groupNo
$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

  1. 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.
  1. If the label is disabled in the interface, it will still be added to the report.
  2. 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?")
# ...