Skip to content

Instantly share code, notes, and snippets.

@ryw
Created April 5, 2015 20:12
Show Gist options
  • Save ryw/0961287e75f34fa41fdd to your computer and use it in GitHub Desktop.
Save ryw/0961287e75f34fa41fdd to your computer and use it in GitHub Desktop.
Short script to run Keen IO funnel
# 1 Install node `brew install node`
# 2 Install coffeescript `npm install coffee-script`
# 3 Edit keen info and steps
# 4 Run script `coffee funnel.coffee`
Keen = require 'keen-js'
keen = new Keen
projectId: "XXX"
writeKey: "XXX"
readKey: "XXX"
steps = [
event_collection: 'signed_up'
actor_property: 'userId'
timeframe: start: "2015-03-01T00:00:00.000Z", end: "2015-03-06T00:00:00.000Z"
,
event_collection: 'created_canvas'
actor_property: 'userId'
timeframe: start: "2015-03-06T00:00:00.000Z", end: "2015-03-09T00:00:00.000Z"
]
funnel = new Keen.Query("funnel", steps: steps)
keen.run funnel, (err, res)->
results = res.result
console.log results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment