Article: BotKit-What are Meta Tags & How to Define and Capture Meta Tags

The Kore.ai XO Platform allows you to add tags to various nodes in a dialog task like dialog node, entity node, etc.

This option is available from the Instance Properties tab, under Advanced Controls.

User 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.
    The platform will roll-up these message level tags to task level. That is if a task ends up as ‘Success/Failed Task’, then all the ‘message level’ tags emitted anywhere during the task execution will be associated with the Success/Failed Task event. You can filter Success Tasks as well as Failed Tasks using the message level tags emitted anywhere during the task execution
  • 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.

The tag values will be emitted at run time:

  • For service, script, webhook and form nodes, tags will be emitted on reaching the nodes;
  • For entity, message, confirmation, and other nodes, tags will be emitted on the successful execution of the nodes.

You can also define Tags as key-value pairs from a Script written anywhere in the application like in the Script node,

Message, Entity, Confirmation Prompts, Error Prompts, Knowledge Task Responses, BotKit SDK, etc.
This would be useful if you want conditional tagging.

Below is the sample to capture the Meta Tags:

data.metaTags = {
"userMetaTags":[],
"sessionMetaTags":[],
"messageMetaTags":[
{
"name":"convId",
"value": conversationMap[data.context.session.BotUserSession.conversationSessionId]["convId"]
},

{
"name":"seqId",
"value": conversationMap[data.context.session.BotUserSession.conversationSessionId]["seqId"]
}
]
}

Note: If the requirement is to work from the builder through Script node, please refer to the below Knowledge Content document.