Analytics for Botkit by Keen IO

Take control of how you track and analyze your key bot metrics.

Easy Integration

Plug Keen-Botkit right into Botkit in seconds with great defaults and customizable tracking options. Learn More.

Full Control

Stream key usage data with complete control over how and where your data is displayed.

Scalable Analytics

Powered by a scalable analytics platform, you are free to focus on what matters most: making your product better.

Supported Platforms

Powered by Keen IO, you are able to use the power of the platform to understand how many messages are going through your system, run cohorts to measure retention, set up funnels to measure task completion, and any key metric unique to your bot. See how to get started.


Example Metrics

Messages Per Hour

The heartbeat of your bot. Messages it receives per hour.

          var messagesPerHourQuery = new Keen.Query("count", {
  event_collection: 'messages_received',
  interval: "hourly",
  timeframe: {
    start: "2016-12-25T00:00:00.000Z",
    end: "2017-01-05T23:59:59.000Z"
  }
});

var messagesPerHourChart = new Keen.Dataviz()
  .el(document.getElementById("metric-01"))
  .height(300)
  .chartOptions({
    chartArea: {
      left: '10%',
      width: '90%',
      top: '10%',
      height: '80%'
    },
    isStacked: true,
    legend: { position: 'none' }
  })
  .prepare();

client.run(messagesPerHourQuery, function(err, res) {
  if (err) throw err;

  // Render visualization
  messagesPerHourChart
    .data(res)
    .render();

});
          
        

Busiest Usage Hours

Calculating at what times users message your bot the most.

          var messagesPerHourQuery = new Keen.Query("count", {
  event_collection: 'messages_received',
  interval: "hourly",
  timeframe: {
    start: "2016-12-25T00:00:00.000Z",
    end: "2017-01-05T23:59:59.000Z"
  }
});

var hourlyMessagesChart = new Keen.Dataviz()
   .el(document.getElementById('metric-02'))
   .chartType('columnchart')
   .height(300)
   .chartOptions({
     chartArea: {
         left: '10%',
         width: '90%',
         top: '10%',
         height: '80%'
     },
     isStacked:true,
     legend: { position: 'none' }
   })
   .prepare(); // start spinner


 client.run(messagesPerHourQuery, function(err, res) {
     if (err) throw('Error!');

     // Normalize the dates
     var now = new Date();
     now.setMinutes(0);
     now.setSeconds(0);

     var nestedData = d3.nest()
     .key(function(d) {
         // Use the hour of day as the key
         return new Date(d.timeframe.start).getHours();
     })
     .rollup(function(leaves) {
         var total = d3.sum(leaves, function(d) { return d.value; });
         // Use the average number of messages at a given hour as the value
         return {
             denominator: leaves.length,
             total: total,
             avg: total / leaves.length
         };
     })
     .entries(res.result);

     // Format your data so it can be drawn as an areachart
     var result = nestedData.map(function(d){
         var start = new Date(now);
         start.setHours(d.key);

         var date = new Date(start.getTime() + (60 * 60 * 1000));
         date.setMinutes(0);
         date.setSeconds(0);

         return {
             value: d.value.avg,
             timeframe: {
                 start: start.toISOString(),
                 end: date.toISOString()
             }
         };
     });

     // Render visualization
     hourlyMessagesChart
       .parseRawData({ result: result })
       .render();
 })
          
        

Most Active Teams

An easy way to keep track of your best customers. Note that you can pass in a more human friendly
way to describe the team than their Slack ID using the payload modifier functionality.

          var popularTeamsQuery = new Keen.Query("count", {
  event_collection: 'messages_received',
  group_by: 'team',
  timeframe: {
    start: "2016-12-25T00:00:00.000Z",
    end: "2017-01-05T23:59:59.000Z"
  }
});

var popularTeamsChart = new Keen.Dataviz()
   .el(document.getElementById("metric-03"))
   .chartType('columnchart')
   .height(300)
   .chartOptions({
     chartArea: {
         left: '10%',
         width: '90%',
         top: '10%',
         height: '80%'
     },
     isStacked:true,
     legend: { position: 'none' }
   })
   .prepare(); // start spinner

// Run the query
client.run(popularTeamsQuery, function(err, res) {
  if (err) throw err;

  // Render visualization
  popularTeamsChart
   .data(res)
   .render();
});
          
        

Take control of your analyitcs with Keen IO and Botkit.