In this How-To, we will explore a scenario in a Banking Bot, where, various metrics will be used to analyze the bot performance and track some trends for business needs.
For details on what Custom Dashboards are and how they are implemented in the Kore.ai Bots platform, refer here.
Problem Statement
A Banking Bot client wants to track the following metrics:
- Usage Statistics based upon the customer type;
- Transaction value breakup;
- Day-wise task success vs failure trends;
- Channel-wise usage details;
- Top tasks that are failing.
This document gives a detailed step-by-step approach to achieving all the above-mentioned scenarios using Custom Dashboard.
This is the Dashboard we will be building:
Pre-requisites
- Bot building knowledge.
- Custom Meta Tags usage, refer here for more.
- A Banking Bot with the dialogs as mentioned below:
- Transfer Money – Dialog task walking the user through the steps in transferring money.
In this diaog, we have included a Script node to add Custom Meta Tag, TransferValue, based upon the amount transferred. Following script was used:if(context.entities.TransferAmount[0].amount > 50000){ tags.addSessionLevelTag("TransferValue","HighValue"); } if(context.entities.TransferAmount[0].amount > 10000) tags.addSessionLevelTag("TransferValue","MediumValue"); if(context.entities.TransferAmount[0].amount > 0) tags.addSessionLevelTag("TransferValue","LowValue");
- Manage Payee – For the user to manage their payee list.
Here we have a Script assigning customerType meta tags:if(context.custType == 3){ tags.addUserLevelTag("CustomerType","Premium"); } if(context.custType == 2){ tags.addUserLevelTag("CustomerType","Gold"); }; if(context.custType == 1){ tags.addUserLevelTag("CustomerType","Regular"); };
- Transfer Money – Dialog task walking the user through the steps in transferring money.
Implementation
Let us consider how each of the metrics mentioned in the problem statement can be implemented using widgets from the Custom Dashboard.
Dollar Value Breakup
- Add Widget
- Query setup:
- Dataset – Analytics
- Select – sessionTag.TransferValue as TransferValue,count(taskName)
This will let the platform know what data to fetch. Here we are using the session tag values added to the Transfer Amount task against the total number of tasks executed. - Group By – sessionTag.TransferValue
- Run to see the results from the above query.
- Widget Setup
- Select Pie chart
- Set Dimension to TransferValue
- Set Metrics to count(taskName)
- See the Preview and if all is fine Update to Dashboard
Customer Type Summary
Repeat the above steps with the following details:
- Add Widget
- Query setup:
- Dataset – Analytics
- Select – userTag.CustomerType as CustomerCategory, count(taskName)
- Group By – userTag.CustomerType
- Run to see the results from the above query.
- Widget Setup
- Select Bar chart
- Set Dimension to CustomerCategory
- Set Metrics to count(taskName)
- See the Preview and Update to Dashboard
Task Fulfillment Trend
Repeat the above steps with the following details:
- Add Widget
- Query setup:
- Dataset – Analytics
- Select – date,metricType, count(metricType) as TotalTasks
- Filter By – metricType = ‘successtasks’ or metricType = ‘failedtasks’
We want to see only Success or Failed Tasks - Group By – date,metricType
- Run to see the results from the above query.
- Widget Setup
- Select Bar chart
- Set Dimension to date
- Set Metrics to TotalTasks
- Set Overlay to metricType
- See the Preview and Update to Dashboard.
Top Failure Tasks
Repeat the above steps with the following details:
- Add Widget
- Query setup:
- Dataset – Analytics
- Select – taskName as TaskName,count(taskName) as Failures
- Filter By – metricType = ‘failedtasks’
We want to see only Failed Tasks - Group By – taskName
- Run to see the results from the above query.
- Widget Setup
- Select Table chart
- Set Dimension to TaskName and Failures
- See the Preview and Update to Dashboard
Channel Volume Trend
Repeat the above steps with the following details:
- Add Widget
- Query setup:
- Dataset – Mesages
- Select – date,channel,count(messageId)
- Group By – date,channel
- Run to see the results from the above query.
- Widget Setup
- Select Line chart
- Set Dimension to date
- Set Metrics to count(messageId)
- Set Overlay to channel
- See the Preview and Update to Dashboard
You Custom Dashboard is ready. Setting the Date Range will give you the required metrics for the business scenarios.