Analytics collector for redis and mongodb
CoffeeScript JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
src
.gitignore
Cakefile
README.md
index.js
package.json

README.md

ortoo-analytics

Analytics collector

Events are immediately stored into redis, before being periodically saved into mongodb

Initialization

analytics.initialize(opts);

Opts:

  • reapInterval - period in ms between transfer from redis to mongodb
  • mongooseConnectionString
  • redisConnectionString

API

analytics.newEvent(data);

Data can contain any properties (with the exception of time) and they will be persisted. However there are some standard and compulsory properties

Compulsory properties

  • context - where we've collected the data from (e.g. 'Server', 'GovernorHub client')
  • eventName - e.g 'NewNoticeboardPost'

Standard properties

  • object - the ID of the object the event is happening to (if applicable)
  • objectType - a string type for the object. Recommended for grouping of objects (e.g. 'NoticeboardPost')
  • user - the ID of the user who triggered the event (if applicable)
  • container - the ID of the object's container (if applicable - e.g. the group a 'NoticeboardPost' belongs to)
  • containerType - a string type for the container