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
end