Introducing Pushpop for Slack: push your analytics data to Slack

Joe Wegner
The Event Log
Published in
3 min readApr 30, 2015

A few months ago, Cory blogged about some of the slack hacks we use at Keen. That was a long list of wonderful integrations that Slack provides out-of-the-box. We use a lot of them, and love them deeply. Slack lets us keep track of most of our work in one place. The missing piece? Analytics. We didn’t have a way to push our most important analytics data to Slack channels so, we built it!

Pushpop for Slack

We built pushpop-slack, a new open source Slack integration that will push alerts to Slack based on your Keen IO event data. Pushpop-slack is an extension of Pushpop, our open source tool for sending analytics reports via email and text based on flexible triggers.

Slacking with Pushpop

The vast majority of our internal use of Pushpop has been sending emails or SMS for weekly analytics reports. Recently we have been thinking that it might be nice to have more lightweight notifications when notable trends start showing up in our analytics. These kind of notifications aren’t really important enough for email, but fit really well with how we use Slack.

pushpop-slack is pretty flexible — you can do all sorts of things like impersonate a user, set a goofy icon, and send attachments. As an example, here is a really basic job I set up that sends a slack message whenever you get more than 30 unique pageviews in an hour:

require 'pushpop'
require 'pushpop-keen'
require 'pushpop-slack'

job do

every 1.hour

keen do
event_collection 'pageviews'
analysis_type 'count_unique'
target_property 'uuid'
timeframe 'previous_1_hours'
end

step 'check_threshold' |pageviews| do
pageviews['value'] > 30 # returning false cancels any subsequent steps
end

slack do |last_response, step_responses|
channel '#general'
username 'PushPop'
message "We're on fire! We've had #{step_responses['keen']} pageviews in the past hour!"
end

As you can see, it’s super simple to start generating messages, and with all of the other Pushpop integrations you can build some pretty cool notifications with very little effort.

Pushpop is similar to some other trigger services, in that it listens for events from anywhere, and then triggers an action to anywhere. The big difference is that Pushpop is much more malleable, and works better for complex recipes. Pushpop can have unlimited triggers and steps in a single job, and gives you a full ruby environment to mold and inspect data for more logical actions.

Right now, Pushpop works with event data from Keen IO. If you don’t yet have an account, you can sign up for free. We plan on adding more analytics backends soon. Post a github issue to let us know which backends you’d like to see supported!

If you’ve got any other questions/comments/requests/GIFS about pushpop-slack please drop them on the github issues page, or come chat with me in Slack!

--

--

Joe Wegner
The Event Log

Career Nerd. Was an IT guy. Is a software engineer (@Keen_IO). Loves Christ. Married to @Erica_Wegner. http://t.co/yEBP9xbDiu