Mixpanel analytics middleware for express for applications catering to the mxit mobi web api.
Mixpanel analytics for express applications catering to the mxit mobi web api.
Install the module with:
npm install mixpanel-mxit
var mixpanel_mxit = require'mixpanel-mxit';appusemixpanel_mxitmiddlewaremixpanel;/* Or with optional error callback: */appusemixpanel_mxitmiddlewaremixpanel console.logerror;
The only error defined right now is:
number: 0 message: 'Header missing: x-mxit-userid-r, probably not a real mxit request'
This is a simple connect (express) style middleware to log mxit user information to mixpanel, it includes all the headers available in each request:
This library has never been used in production and the tests while looking awesome do not actually test what is being sent to mixpanel. The code does appear to work and in my limmited testing I havn't encountered anything unexpected.
Implement an optional increment to the people.requests variable per request. Full out tests so that the actual data going to mixpanel is tested.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt. Please write tests for any changes and make sure they pass :)
Copyright (c) 2013 Pierre Hugo
Licensed under the MIT license.