Generic analytics tracking wrapper
Current builtin services:
- mixpanel
Usage
var tracking = ;; tracking; tracking;
Adding services
Services should call tracking._addTracker(name, config)
to register themselves. You can either add services here, or application specific ones.
//my-custom-tracker.js var tracking = ; //make relative if actually including in this repo moduleexports { //Export as a configure method for consistency var { //identify will receive a userId, and a userData object //do something with the data }; var { //track will receive an event name, and data object (may be empty if not provided }; //Register the tracker tracking;};
Your application will then use it like so:
var tracking = ;var custom = ;custom; tracking;