{"id":21368,"date":"2019-06-06T07:33:41","date_gmt":"2019-06-06T06:33:41","guid":{"rendered":"https:\/\/developer.kore.ai\/v7-1\/?p=21368"},"modified":"2019-11-01T09:32:31","modified_gmt":"2019-11-01T09:32:31","slug":"custom-meta-tags","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-1\/docs\/bots\/bot-builder-tool\/dialog-task\/custom-meta-tags\/","title":{"rendered":"Custom Meta Tags"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>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.<\/p>\n<p>By adding <strong>Custom Meta Tags<\/strong> 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.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Defining_Meta_Tags\">Defining Meta Tags<\/span><\/h2>\n<p>Kore.ai Bot builder platform allows you to add tags to various nodes in a dialog task like dialog node, entity node, etc.<\/p>\n<p>This option is available from the\u00a0<strong>Instance Properties<\/strong> tab<\/p>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/12\/custom-tags.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21371\" src=\"\/wp-content\/uploads\/sites\/12\/custom-tags.png\" alt=\"\" width=\"820\" height=\"707\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/12\/20221201094946\/custom-tags.png 820w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/12\/20221201094946\/custom-tags-300x259.png 300w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>You can define these tags at three levels:<\/p>\n<ul>\n<li><strong>User Level<\/strong>: These tags can be added to the user&#8217;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.<\/li>\n<li><strong>Message Level<\/strong>: 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.<br \/>\nThe platform will roll-up these message level tags to task level. That is if a task ends up as &#8216;Success\/Failed Task&#8217;, then all the &#8216;message level&#8217; 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<\/li>\n<li><strong>Session Level<\/strong>: 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.<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>You can also define Tags as key-value pairs from <strong>Script<\/strong> 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.<\/p>\n<p>Be aware that Script tagging would work only if the prompt where you added the tag script is triggered during the conversation.<\/p>\n<p>Following script can be used for adding meta tags:<\/p>\n<ul>\n<li>To add a User level tag:<br \/>\n<code>tags.addUserLevelTag(\"tagname\",\"tagvalue\")<\/code><\/li>\n<li>To add a Session level tag:<br \/>\n<code>tags.addSessionLevelTag(\"tagname\",\"tagvalue\")<\/code><\/li>\n<li>To add a Message level tag:<br \/>\n<code>tags.addMessageLevelTag(\"tagname\",\"tagvalue\")<\/code><\/li>\n<\/ul>\n<p>The tagvalue can be a value or a variable name containing the value.<\/p>\n<p><strong>Updating Meta Tag Values<\/strong><\/p>\n<p>Chances are the Meta Tag values, once assigned, may be modified, for either business or other reasons. In such cases following points need to be noted:<\/p>\n<ul>\n<li>The latest value assigned for a key will over-ride the previously assigned value.<\/li>\n<li>The updates to the tags follow the following rules:\n<ul>\n<li><strong>Message-level tags<\/strong>: You may set value for a tag multiple times within the script and the last set value will be assigned against the message. The value cannot be updated after the message is sent to the user<\/li>\n<li><strong>Session level tags<\/strong>: Value for a given tag can be set any number of times throughout the session. The last value assigned will be retained and this is the value that you should be using for all analytics purposes. Value cannot be updated after the session is closed.<\/li>\n<li><strong>User level tags<\/strong>: Value for a given tag can be set any number of times throughout the session. The last value assigned will be retained and this is the value that you should be using for all analytics purposes. Value can be edited at any time.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Using_Meta_Tags\">Using Meta Tags<\/span><\/h2>\n<p>Once you have defined the Meta Tags, you can:<\/p>\n<ul>\n<li>Use the filter option from Bot Metrics to filter the conversations based upon the Meta Tag values. The export file for the Bot Metrics would include the Meta tag information, too. <a href=\"\/v7-1\/docs\/bots\/analyzing-your-bot\/bot-analysis\/\" target=\"_blank\" rel=\"noopener noreferrer\">See here for more<\/a>.<\/li>\n<li>Use the filter option from <a href=\"\/v7-1\/docs\/bots\/analyzing-your-bot\/dashboard\/#Tag_based_Filters\" target=\"_blank\" rel=\"noopener noreferrer\">Bot Builder Dashboard<\/a> and <a href=\"\/v7-1\/docs\/bots\/bot-admin\/adminconsole\/#Dashboard\" target=\"_blank\" rel=\"noopener noreferrer\">Admin Console Dashboard<\/a> to filter the Bot activity details based upon the Meta Tag values.<\/li>\n<li>Use to filter the Chat History. Export of Chat History will also include the Meta Tag values. <a href=\"\/v7-1\/docs\/bots\/bot-admin\/analytics\/#Viewing_Chat_History\" target=\"_blank\" rel=\"noopener noreferrer\">See here for more<\/a>.<\/li>\n<li>Filter the records from Conversation History API and Sessions API by meta tags.<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"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...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-21368","post","type-post","status-publish","format-standard","hentry","category-dialog-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/posts\/21368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/comments?post=21368"}],"version-history":[{"count":7,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/posts\/21368\/revisions"}],"predecessor-version":[{"id":22637,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/posts\/21368\/revisions\/22637"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/media?parent=21368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/categories?post=21368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/tags?post=21368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}