The article provides a guide on customizing Customer Satisfaction (CSAT) surveys for both chat and voice channels in Smart Assist. It outlines steps to add multiple questions to CSAT forms for each channel type.
This article includes code snippets for updating the feedback script and offers visual samples of CSAT rating dialogs for both chat and voice channels.
Note: Smart Assist administrators can customize CSAT verbiage and add multiple CSAT questions.
Adding Multiple questions in CSAT for Chat channels.
Please find the below steps to add the multiple questions in the CSAT for Chat channels,
Steps:
- Go to Build → Digital Skills → Digital Forms → CSAT5Options form.
- Add the questions in the form based on your requirement
From the above screenshot, the highlighted part is the additionally added CSAT question in the form.
- Now, to save the added CSAT question in the context, go to SAT_CSAT_Feedback_Script and store the context path of the added question (
SmartAssistScore
) of the form in a variable.
Example:
"smartassistScore":context.forms.CSAT5Options.SmartAssistScore,
- Adding the multiple questions in the CSAT for Voice channels:
Please follow the below steps, to add the multiple questions in the CSAT for Voice channels (AudioCodes / SAVG).
-
By default there is already a CSAT question configured in the Entity node
SAT_CSAT_Feedback_Entity which is connected to SAT_CSAT_Feedback_Script,
-
Now add an entity node for another CSAT question after the SAT_CSAT_Feedback_Entity entity node and configure the user prompt.
- Now, to save the entity value in the context, go to SAT_CSAT_Feedback_Script and assign the context path of the entity node (SAT_CSAT_Feedback_Entity_1) to a variable.
Example:
"smartassistScore":context.entities.SAT_CSAT_Feedback_Entity_1,
By following the above steps we can add the additional CSAT questions for Voice channels.
The updated script of the SAT_CSAT_Feedback_Script:
try {
var channel;
if(context.session.BotUserSession && context.session.BotUserSession.channels && context.session.BotUserSession.channels.length && context.session.BotUserSession.channels[0].type){
channel = context.session.BotUserSession.channels[0].type;
}else if(context.session.BotUserSession && context.session.BotUserSession.lastMessage && context.session.BotUserSession.lastMessage.channel){
channel = context.session.BotUserSession.lastMessage.channel;
}
if (channel === "audiocodes" || channel === "korevg") {
context.csat_feedback_payload = {
"channel":channel,
"userId":context.session.opts.userId,
"botId":context.session.opts.streamId,
"score":context.entities.SAT_CSAT_Feedback_Entity,
"smartassistScore":context.entities.SAT_CSAT_Feedback_Entity_1, //Added smartassist score in the payload from the newly added question in an Entity Node -> SAT_CSAT_Feedback_Entity_1
"comments":"",
}
} else {
var formInputPayload = context.forms.CSAT5Options;
context.formInputPayload = formInputPayload;
context.csat_feedback_payload = {
"channel":channel,
"userId":context.session.opts.userId,
"botId":context.session.opts.streamId,
"score":context.forms.CSAT5Options.Score,
"smartassistScore":context.forms.CSAT5Options.SmartAssistScore, //Added smartassist score in the payload from the newly added question in the CSAT5Options Form
"comments":context.forms.CSAT5Options.Comments,
"session": context.session
}
}
} catch (err) {
context.error={
"message":"Error in csat feedback script",
"error":err
}
}
The CSAT rating dialog task flow:
Below are the working samples:
- For Chat:
CSAT questions in form when triggered in Chat
- For Voice:
CSAT questions when triggered in Voice call
Content Credit @praveen.adari