Skip to content

Instantly share code, notes, and snippets.

View wetzler's full-sized avatar

Michelle Wetzler wetzler

  • Bay Area, California
View GitHub Profile
@wetzler
wetzler / gist:6909882
Last active May 16, 2020 13:13
This gist shows you how to run a retention analysis. I blogged about how to run a retention analysis here: https://keen.io/blog/47823687779/how-to-do-a-retention-analysis/
require 'rubygems'
require 'keen'
require 'json'
require 'date'
require 'active_support/all' #for datetime calculation e.g. weeks.ago.at_beginning_of_week
require 'simple_xlsx' #for outputting excel files
require 'cgi' #for URL encoding
#================================oOo===================================
@wetzler
wetzler / gist:6816497
Last active December 24, 2015 14:59
Here's how you can get query results for two Keen IO series, in parallel, and then combine them in one multiline chart.I really want to rewrite this to run N queries at a time, but this works for now.
Keen.configure({
projectId: id,
readKey: key
});
// Timeframe parameters for queries
var timeframe = "last_14_days"
var interval = "daily"
Keen.onChartsReady(function(){
@wetzler
wetzler / gist:6629918
Last active February 23, 2019 21:31
a key with magical powers
d90e5b5598497773de1c57407dd54d65934ba1b5911f6f47311d3c729f510bb5c295284780017a56f17e49234f19c009bfa57f7941413a5dd3c282d7db3692a192b58ea926b637cdcd11377e1e74086641e0672c8b3406aeed49d63ee0a3a3d3751ae7744f08b999df38ca2ccdbb9a2c
@wetzler
wetzler / gist:5210061
Last active December 15, 2015 05:38
This script creates a retention funnel query in Keen IO and outputs both the funnel query name and the results of the query.
require 'rubygems'
require 'net/http'
require 'net/https'
require 'uri'
require 'json'
require 'date'
require 'active_support/all' #for datetime calculation e.g. weeks.ago.at_beginning_of_week
# Keen Project Info
$projectID = "your project ID"
@wetzler
wetzler / gist:4478332
Last active December 10, 2015 18:58
Kickfolio's (minified) code to embed Keen IO charts in their user dashboards. They have 3 line charts (last 7 days, last 24 hours, and last 4 weeks) which show the number of user "connect" sessions for a given app (identified by the filter app.PublicKey). For more context, see this blog post: http://blog.keen.io/post/39950174904/kickfolio-uses-k…
Keen.configure(window.ENV.keenProjectId,window.ENV.keenApiKey),
Keen.onChartsReady(function(){
var e=new Keen.Series("connect",{
analysisType:"count",
timeframe:"last_7_days",
interval:"daily"
}),
t=new Keen.Series("connect",{