Hello Team,
There is a use where we need to present CSAT survey only during the session closure rather than showing after FAQ or end of Dialog task. How can we achieve this step using the Botkit?
Hello Team,
There is a use where we need to present CSAT survey only during the session closure rather than showing after FAQ or end of Dialog task. How can we achieve this step using the Botkit?
Hello team,
Can anyone please respond?
Hello Lucifer,
Welcome to Kore.ai Community.
For the Approach with BotKit SDK
on_event Hook in BotKitKore.ai BotKit emits an event when a session or task ends:
In your BotKit app, you can capture this event:
sdk.on_event = function(requestId, data, callback) {
// Check if this is session closure
if (data.event && data.event.eventType === "endDialog") {
// Trigger your CSAT survey logic here
sendCSATSurvey(requestId, data, callback);
} else {
callback();
}
};
Then define your custom function:
function sendCSATSurvey(requestId, data, callback) {
// Post a CSAT survey message
const csatMessage = {
type: "message",
messages: [
{
type: "quickReplies",
text: "How would you rate your experience?",
quickReplies: ["π Good", "π OK", "π Bad"]
}
]
};
return sdk.sendBotMessage(csatMessage, callback);
}
This lets you inject your CSAT survey only on session close events, independent of where in the dialog flow the session ends.
Note:
Ensure the CSAT survey is not auto-triggering immediately based on built-in settings in the Kore.ai platform, otherwise the BotKit message might duplicate it.
You can configure the default CSAT survey behavior under:
Bot Builder β Configure β CSAT Settings
This might include toggles like:
So before handling through code:
Disable default survey if you want full control via BotKit
You are using BotKit SDK as middleware
You subscribe to on_event or a custom event
The survey injection is controlled by code, not by platform automatic survey flow
When this Cannot Work
If your bot is purely built using:
Example Use Case of Event Detection
Hereβs how the Kore.ai BotKit SDK defines events including session close:
sdk.on_event = function(requestId, data, callback) {
// eventType could be 'endDialog', 'endFAQ', etc.
console.log("Event received: ", data.event.eventType);
callback();
};
Using this, you can add custom logic only when a session fully ends.
Hi Srujan,
Thanks for your response. And we have to save these CSAT to show to the client just like the Feedback Dashboard we have. But if I go with this approach, we cannot save the csat and show it as a dashboard right?