Skip to main content

$analytics.setNps

This method records the evaluation from the user in the script. For example, it can be net promoter score (NPS) or customer satisfaction score (CSAT).

tip
You can find statistics on evaluations in the Project overview section.

Syntax

The method accepts any positive number as an argument.

$analytics.setNps(5)
caution
You can record only one score in one session. If the method is called again, the value will be overwritten.

How to use

state: ServiceEvaluation
a: Thank you for your time. How would you rate your experience with our chat bot?
buttons:
"5 – excellent" -> ./5
"4 – good" -> ./4
"3 – ok" -> ./3
"2 – needs improvement" -> ./2
"1 – unsatisfactory" -> ./1

state: 1
intent: /Evaluation/Unsatisfactory
q: * (1/one/0/zero) *
a: Thank you. Your opinion is very important to us.
script: $analytics.setNps(1);

state: 2
q: * (2/two) *
intent: /Evaluation/NeedsImprovement
a: Thank you. Your opinion is very important to us.
script: $analytics.setNps(2);

state: 3
q: * (3/three) *
intent: /Evaluation/Ok
a: Thank you. Your opinion is very important to us.
script: $analytics.setNps(3);

state: 4
q: * (4/four) *
intent: /Evaluation/Good
a: Thank you! See you again.
script: $analytics.setNps(4);

state: 5
q: * (5/five) *
intent: /Evaluation/Excellent
a: Thank you! See you again.
script: $analytics.setNps(5);