Botmetrics ❤️ Botframework️
Originally posted on Medium
If you’re like us, and we suspect you are, you’ve probably lovingly crafted a bot using Microsoft’s Bot Framework (the most popular way for developers to build bots.) Being data driven, you’re now curious to know how many users you’re getting each day, what they’re are saying to your bot, and to see how many of them are reaching the “conversion point” in your Bot’s flow.
Botmetrics, is an open source analytics package that let’s you meet your customer privacy and security requirements while instantly getting answers to these questions with minimal setup for bots built with Bot Framework.
Integrating Botmetrics consists of two parts — the first is the Bot Framework middleware module that instruments your Bot with a few lines of code and the second is the Botmetrics service which analyzes, visualizes and lets you act on the metrics collected.
If this sounds like something your bot can’t live with out — let’s get started!
Part 1: Adding Analytics Middleware to your Bot Framework bot
- Install the middleware using npm
- Instantiate it in your code with two environment variables:
- BOTMETRICS_BOT_ID that uniquely identifies this bot.
- BOTMETRICS_API_KEY that ensures that only you can send metrics for your bot.
3. Use the middleware in your bot by adding it to your bot.use() function.
A more detailed example is available here.
Next let us setup the service and get the values we need for the two environment variables we created.
Part 2: Connect to Your Private Bot Metrics Analytics Service
- Deploy your own private instance of Botmetrics Service with one click!
- Log On onto your instance. Setup you Facebook bot by adding your bot’s “Facebook Page Access Token” to Botmetrics.
Note: We currently support Facebook Bots via the middleware — shoot us a note if you want to use this with a Slack or Kik bot.
3. Now, finally, set the BOTMETRICS_API_KEY and BOTMETRICS_BOT_ID environment variables in your Bot’s environment based on the values in the settings page and restart your bot!
Restart your bot and you can now instantly see detailed metrics about your customers such as new and active user growth, demographic and geographic distributions, and user action attributes.
In addition, with no engineering effort you will also have the ability to segment users based on these characteristics and send them targeted smart time-zone aware notifications. All while maintaining the privacy and control over user communications.
Join the Community
Your questions, contributions and feedback about the middleware or the service are always welcome on Github and you can also join our community on Slack.
☞ We read every response on Medium or reply on Twitter, so don’t hesitate to let us know what you think.
☞ Get a weekly newsletter of the best Bot & AI news: Sign up for botweekly.
☞ Please tap or click “︎❤” to help to promote this piece to others.