Created
December 14, 2014 08:15
-
-
Save anonymous/f26fbcdd8a11b66772d9 to your computer and use it in GitHub Desktop.
universal-analytics with arduino
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 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