Permalink
Browse files

Use the example SDK bootstrapping from the Keen IO JS docs

  • Loading branch information...
1 parent 28a470a commit 0ce7ddb2f26a4833180a125d312603cf33b17e3a @dzello dzello committed Mar 23, 2013
Showing with 5 additions and 8 deletions.
  1. +0 −3 public/javascripts/app.js
  2. +5 −5 views/layout.erb
@@ -1,6 +1,3 @@
-Keen.configure(this.environment.keenProjectId,
- this.environment.keenApiKey)
-
function drawVisualizations() {
new Keen.Metric("votes", {
analysisType: "count"
View
@@ -100,12 +100,12 @@
</div>
</div>
</div>
- <script src="https://keen_web_static.s3.amazonaws.com/code/keen-1.1.0.js" type="text/javascript"></script>
<script type="text/javascript">
- this.environment = {
- keenProjectId: "<%= ENV['KEEN_PROJECT_ID'] %>",
- keenApiKey: "<%= ENV['KEEN_API_KEY'] %>"
- }
+ var Keen=Keen||{configure:function(a,b,c){this._pId=a;this._ak=b;this._op=c},addEvent:function(a,b,c,d){this._eq=this._eq||[];this._eq.push([a,b,c,d])},setGlobalProperties:function(a){this._gp=a},onChartsReady:function(a){this._ocrq=this._ocrq||[];this._ocrq.push(a)}};
+ (function(){var a=document.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"==document.location.protocol?"https://":"http://")+"dc8na2hxrj29i.cloudfront.net/code/keen-2.0.0-min.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)})();
+
+ // Configure the Keen object with your Project Token and API Key
+ Keen.configure("<%= ENV['KEEN_PROJECT_ID'] %>", "<%= ENV['KEEN_API_KEY'] %>");
</script>
<script src="/javascripts/app.js" type="text/javascript"></script>
</body>

0 comments on commit 0ce7ddb

Please sign in to comment.