Using Slack to monitor your Integration

How we use Slack to create a BCC of our user’s experience

Market.Space
3 min readMar 17, 2016

Experiencing what your customers experience while using your Slack integration can be a challenge. You know what you sent them, you have logs and have tested everything a hundred times, but the ability to look over your customers shoulder and see how everything looks, to ensure that their experience is perfect, this is a problem worth solving.

Market.Space

With our Slack integration, Market.Space, Slack users create a group of companies (a market space) and receive product launches, new features, app updates, rating changes, news mentions, trending social posts and dozens of other events affecting the companies they care about.

A typical Market.Space

Being able to know exactly what the user’s channel looks like is important for us, as we want to ensure that the quality of the business intelligence we send is high and the noise or volume is just right. With our web app it is easy to assume your user’s profile and see what they see, with our email digest feature we BCC all the emails to a folder so we can spot check or dig in if there are any reported problems, but with Slack we had no visibility of the front-end.

SlackTracker

We were thinking about our monitoring problem and how it would be perfect if we could BCC the user’s slack channel feed to our own channel. We needed a scalable solution that would allow us to spot check thousands of user feeds. We can use this to dig deep and trouble shoot any problems that are reported as well as identify users who are not receiving any data so we can reach out and suggest a few ways to better use our platform. I remembered a conversation I had with a developer who had a CRM tool that created a new Slack channel for each user when they accessed the system. This got me thinking.

I realized I could solve my Slack integration tracking problem by using a Slack integration (yes..fun!). I created a new slack team (slack_tracker) and created a custom integration to our backend. The plan was simple, auto generate channels in slack_tracker and bcc our users to create a custom backend tool to allow us to monitor our user’s experience.

Our simple but effective solution in action. Notice each channel is a user and we can easily view their feeds.

Let’s do this.

First thing we needed to do was auto-generate the channel when a user completed signup/integration with our system. All of our users have an email in our system so we used their email address as their channel name. Channel names cannot be longer than 21 characters or have ‘@’ or ‘.’ in them so we replace these characters with underscores and trim where needed. It is important that the names be visually identifiable so our team could easily discuss and access them.

Example: jason@market.space becomes #jason_market_space

Using the ‘channels.create’ api we create the new channel (node ftw):

function get_name(name){
//format as mentioned above
return name.replace('@','_').replace(/\./g,'_').substring(0, 21);
}
//create new channel
var options = {
url: “https://slack.com/api/channels.create?token=xoxp-11111111111-143543-1232323232-1asf1451tj&name=" + get_name('jason@market.space'),timeout: 20000
};
return rp(options).then(function(res){
return JSON.parse(res).ok;
});

Once this is done, we have a place to ‘bcc’ the Market.Space cards we are sending to our customers:

var _channel = '#' + get_name('jason@market.space');//target channel
card.channel = _channel;
//send to slacktracker
var hook = 'https://hooks.slack.com/services/T11TTXW4Z/A1GGRHWAQ';
var slack = new Slack();
slack.setWebhook(hook);
slack.webhook(card, function(err, response) {callback();});

Now any time we send data to a client, we also send it to the slack_tracker account. This simple solution has really empowered our company to monitor and improve the quality and accuracy of the competitive business intelligence we share with our customers.

Feel free to reach out. I am active in the Slack developer community, go to all the Meetups in SF and can be found on Slack Developer Hangout (@jbeatty) where Market.Space powers the #news channel ! -Jason Beatty

--

--

Market.Space

Follow your competitors, clients, prospects and portfolios