Skip to content

Instantly share code, notes, and snippets.

@oimou
Forked from anonymous/universal-analytics.js
Last active August 29, 2015 14:11
Show Gist options
  • Save oimou/b21b40f3275efea157c0 to your computer and use it in GitHub Desktop.
Save oimou/b21b40f3275efea157c0 to your computer and use it in GitHub Desktop.
var ua = require("universal-analytics");
var j5 = require("johnny-five");
var visitor = ua("UA-XXXX-XX");
var arduino = new j5.Board({
repl: false
});
arduino.on("ready", function () {
var btn = new j5.Button(2);
btn.on("up", function () {
console.log("event sent");
visitor.event("arduino", "click").send();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment