While analyzing your Bot performances, you might want to give preference to or discard a particular scenario. For example, you might want to track how many people are booking tickets to Chicago. Or you might want to track how a specific user, a premium customer, requests are being catered to.
By adding Custom Meta Tags to the conversation flows, you will be able to profile bot user conversations and derive business-critical insights from your bot usage and execution metrics. Tags can be defined as part of the bot definition at any point of interest. When users interact with your bot, the platform will dynamically resolve these tags and adds them to chat transcripts so that you can later filter your conversations, and flows using those tags.
You can define these tags at three levels:
- User Level: These tags can be added to the user’s profile information to capture user information. For example, to track conversations with a premium customer you will define a user-level tag with the user name or some qualifier as the value.
- Message Level: These tags can be added to the message of the current node. If the current node is not associated with a message, then the tag gets added to the immediately previous node that has a message associated with it. From the above example, to track bookings to a specific city Chicago, you would be defining a Message Level tag.
- Session Level: These tags can be added at the current session of the user. These can be used to track the conversation sessions from a specific time frame say holiday season or a geographic domain.
You can also define Tags as key-value pairs from Script written anywhere in the application like Script node, Message, entity, confirmation prompts, error prompts, Knowledge Task responses, BotKit SDK, etc. This would be useful if you want conditional tagging.
Be aware that Script tagging would work only if the prompt where you added the tag script is triggered during the conversation.
Following script can be used for adding meta tags:
- To add a User level tag:
tags.addUserLevelTag("tagname","tagvalue")
- To add a Session level tag:
tags.addSessionLevelTag("tagname","tagvalue")
- To add a Message level tag:
tags.addMessageLevelTag("tagname","tagvalue")