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" | |
}); |
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>", |
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 numLevels = 10 | |
var funnelSteps = prepareFunnel(numLevels) |
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 |
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({ |
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>" |
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) { |
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) { |
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
#!/usr/bin/env ruby | |
TEMPLATES_DIRECTORY = File.expand_path('../templates', __FILE__) | |
require 'date' | |
require 'pushpop' | |
require 'active_support/all' #for datetime calculation e.g. weeks.ago.at_beginning_of_week | |
job do |
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.ready(function(){ | |
// ---------------------------------------- | |
// Total Session Count | |
// How it works: | |
// Given a timeframe, calculate the number of unique session IDs found in the collection "screen_view" | |
// We use the "screen_view" collection because we know there is at least 1 screenview for every session. | |
// ---------------------------------------- | |
var sessions_count = new Keen.Query("count_unique", { | |
eventCollection: "screen_view", |