Slack: How to track MI Chatbot usage

To analyze user engagement with the MI Slack App, you can query necessary data from the respective database tables.  

MI Slack App usage information is recorded daily to the Metric Insights MySQL Database and contains the following information:

  1. Shown Tiles
  2. Daily Slack App usage
  3. User's feedback
  4. Parsed data from User requests 
  5. User requests
  6. Sharing events

NOTE

  • No data is logged for the day when no content has been posted to a Slack channel.
  • Emails are tracked for all users in a Slack channel, not only Metric Insights Users.

1. Connect to MySQL Database

To access MySQL Database, do the following:

  1. Connect to the server over SSH (you must be an admin with root rights)
  2. Run the Command-line Client and connect to the Database with mysql -D dashboard command  

2. Query the list of "MI Slack App" log tables

To see the list of tables:

  1. Use the show tables; command
show tables like 'slack_log%';

3. Track User Engagement

3.1. Shown Tiles

Tiles that are shown in the Slack channel are stored in the slack_log_answer table.

Fields that can be queried from the table slack_log_answer:

  1. "id" – answer ID
  2. "question" – question ID ("id") from the table "slack_log_question"
  3. "name" – Tile name
  4. "tile_uniq_id" – Tile ID
3.2. Daily Slack App usage

Tiles that are shown in a Slack channel and users who have seen these Tiles are stored in the slack_log_daily_usage table.

Fields that can be queried from the table slack_log_daily_usage:

  1. "id" – unique identifier for the entity "daily usage"
  2. "created_at" – usage date (the date when the Tile has been shared)
  3. "user_email"– emails of Slack users who are in the channel
  4. "channel_name" – name of channel where result was shared/posted
3.3. User's feedback

User feedback on query results is stored in the slack_log_feedback table.

  • User comments are recorded when a User clicks the "Unexpected result?" button and enters feedback in the "Results feedback" pop-up.

Fields that can be queried from the table slack_log_feedback:

  1. "id" – feedback ID (User commentary ID)
  2. "question" – question ID ("id") from the table "slack_log_question"
  3. "answer" – answer ID ("id") from the table "slack_log_answer"
    • This value can be empty if User gives feedback on all of the Tiles shown to them by the MI Slack App, not a specific Tile.
  4. "text" – text of feedback
3.4. Parsed data from User requests

Data from User requests parsed by the NLU-service is stored in the slack_log_parsed_question table.

Fields that can be queried from the table slack_log_parsed_question:

  1. "id" – parsed question ID
  2. "question" – question ID  ("id") from the table "slack_log_question"
  3. "data" – User request parsed by the NLU-service
3.5. User requests

User requests are stored in the slack_log_question table.

All fields that can be queried from the table slack_log_question:

  1. "channel_name" – "DM" value means that the question was asked in a direct message with the MI Slack App
  2. "created_at" datetime when a question was asked
  3. "username"– username in Slack
  4. "question" – question that was asked in a Slack channel
  5. "id" – question ID
  6. "user_id" – user ID in Slack
  7. "channel_id" – Slack channel ID
  8. "event_id" – event is a User interaction with the MI Slack App that is recorded to the database

 

3.6. Sharing events

Sharing events are logged to the table slack_log_share_tile.

  • When a User clicks the "Share" button in a Slack channel, information about this event is logged to the corresponding database table.

Fields that can be queried from the table slack_log_share_tile:

  1. "id" – shared Tile ID
  2. "created_at" – share datetime
  3. "answer" – answer ID ("id") from the table "slack_log_answer"
  4. "channel_id" – channel ID in Slack
  5. "channel_name" – name of the channel where the query result (Tile) was shared
  6. "viewers" – count of Users in a channel when the Tile was shared

4. Create a Dataset in Metric Insights with Usage data

You can also build Datasets and elements in Metric Insights with User Engagement data fetched from the database tables.