Skip to content

Tags

Tags are a way to organize conversations, they can be used for filtering and finding users and conversations in the studio. The tag and untag Bubblescript statements set and clear tags on conversations from the running conversation.

A tag is always a string. Tags can have any string content you want be it either dynamically created based on the data or a static tag.

Scoped tags

By using a color (:) in a tag, a tag is grouped under a common namespace. This can be used to group tags together, for instance in the analytics tags overview.

This can also be used to create a funnel of sorts:

dialog survey do
  answer1 = ask "what is your name?"
  tag "survey:name_given"

  answer2 = ask "what is your age?"
  tag "survey:age_given"
end

This way, the analytics section shows a nice overview of 'how far' users come in a conversation.

Enum-scoped tags

Tags that contain a double colon, (::), are "enum tags". Only a single tag with a double colon can exist for any given prefix. When using the tag command, other tags get automatically unset, as the following example shows:

dialog main do
  tag "inbox::sales"
  # conversation.tags now is ["inbox::sales"]

  # ...
  tag "inbox::support"
  # conversation.tags now is ["inbox::support"]; inbox::sales is removed

end

Predefined tags

By defining a tags YAML file in the root of a bot, tags can be set up on beforehand.

tag_groups:
  - key: inbox
    label: Inbox
    tags:
      - label: Inbox
        tag: inbox
      - label: Sales
        tag: sales
      - label: Support
        tag: support