View gist:8739951
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var query = new Keen.SavedQuery("activity_09_2013"); | |
query.getResponse(function(response){ | |
console.log(response.result); | |
// Call Michelle's gross function | |
drawMyLineChart(response, "daily", div , title) | |
}); | |
function drawMyLineChart(response, interval, div, title) { |
View gist:8986843
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Keen.onChartsReady(function() { | |
var metric = new Keen.Metric("Stripe_Events", { | |
analysisType: "sum", | |
targetProperty: "data.object.amount_refunded", | |
filters: [{"property_name":"type","operator":"eq","property_value":"charge.refunded"}] | |
}); | |
metric.draw(document.getElementById("someDiv")); | |
}); |
View gist:9127225
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Keen.onChartsReady(function() { | |
var totalRevenueSeries = new Keen.Series("transactions", { | |
analysisType: "sum", | |
timeframe: "last_30_days", | |
interval: "daily", | |
targetProperty: "amount" | |
}); | |
var totalActiveUsersSeries = new Keen.Series("plays", { |
View gist:9241017
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Keen.onChartsReady(function(){ | |
var visitors = new Keen.Metric("visited_form", { | |
analysisType: "count" | |
}); | |
var formsStarted = new Keen.Metric("form_started", { | |
analysisType: "count" | |
}); |
View gist:9697727
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang='en'> | |
<head> | |
<script> | |
var Keen=Keen||{configure:function(e){this._cf=e},addEvent:function(e,t,n,i){this._eq=this._eq||[],this._eq.push([e,t,n,i])},setGlobalProperties:function(e){this._gp=e},onChartsReady:function(e){this._ocrq=this._ocrq||[],this._ocrq.push(e)}};(function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=("https:"==document.location.protocol?"https://":"http://")+"dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0-min.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})(); | |
// Configure the Keen Client | |
Keen.configure({ | |
projectId: "<your project ID>", |
View gist:11159633
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Keen=Keen||{configure:function(e){this._cf=e},addEvent:function(e,t,n,i){this._eq=this._eq||[],this._eq.push([e,t,n,i])},setGlobalProperties:function(e){this._gp=e},onChartsReady:function(e){this._ocrq=this._ocrq||[],this._ocrq.push(e)}};(function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=("https:"==document.location.protocol?"https://":"http://")+"dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})(); | |
Keen.configure({ // configure the Keen Client | |
projectId: projectId, | |
readKey: readKey | |
}); | |
Keen.onChartsReady(function() { | |
var daysInChart = 30 |
View gist:11160314
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var Keen=Keen||{configure:function(e){this._cf=e},addEvent:function(e,t,n,i){this._eq=this._eq||[],this._eq.push([e,t,n,i])},setGlobalProperties:function(e){this._gp=e},onChartsReady:function(e){this._ocrq=this._ocrq||[],this._ocrq.push(e)}};(function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=("https:"==document.location.protocol?"https://":"http://")+"dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})(); | |
var projectId = "<project_id>"; | |
var readKey = "<project_key>"; | |
// make sure Keen IO environment variables are set | |
if (projectId != "" && readKey != "") { | |
// configure the global Keen Client | |
Keen.configure({ |
View gist:11160518
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang='en'> | |
<head> | |
<script> | |
var Keen=Keen||{configure:function(e){this._cf=e},addEvent:function(e,t,n,i){this._eq=this._eq||[],this._eq.push([e,t,n,i])},setGlobalProperties:function(e){this._gp=e},onChartsReady:function(e){this._ocrq=this._ocrq||[],this._ocrq.push(e)}};(function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=("https:"==document.location.protocol?"https://":"http://")+"dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0-min.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})(); | |
// Configure the Keen Client | |
Keen.configure({ | |
projectId: "<your project ID>", | |
readKey: "<your read key>" |
View gist:19465e0e283e0f25d605
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Keen.onChartsReady(function() { | |
var dataPointsInChart = 7 // Number of days in your line chart | |
calculateConversionTrend(dataPointsInChart, "conversionLineChart") | |
function calculateConversionTrend(dataPointsInChart, div) { | |
var dataForLineChart = [] | |
var i = 0 | |
while (i < dataPointsInChart) { |
View gist:f1dc8fe3cf0270fc9d34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Keen.onChartsReady(function(){ | |
var dataPointsInChart = 7 // Number of days in your line chart | |
calculateConversionTrend(dataPointsInChart, "conversionLineChart") | |
function calculateConversionTrend(dataPointsInChart, div) { | |
var dataForLineChart = [] | |
var i = 0 | |
while (i < dataPointsInChart) { |
OlderNewer