peaksandpies/universal-analytics — pull request #20 by otothea (2014-07-28 18:43:10+00:00)
Title: Add koa compatible middleware function to lib

Added another middleware function that is compatible with the koa framework context:

var koa = require("koa");
var ua = require("universal-analytics");

var app = koa();
app.use(ua.koa("UA-XXXX-Y"));

// Then...in the request context
this.req.visitor.event('name', 'action', 'label').send();