Application tracking that simplifies the process of gathering analytics and avoids convoluted conventions.
The logic is minimal, lightweight, yet can work both on the server and the client, with asynchronous syncing of the client data.
To run the examples go to the dir and execute the server script
$ cd [repo]/examples/[folder]/
$ node server.js
Using npm
node install apptrack
When Apptrack is initiated you can pass the selected store, among other options:
Apptrack = require("apptrack");
var apptrack = new Apptrack({ store : "redis", db: db });
The library can operate independently but optionally can be connected to the server using a middleware
// middleware
app.use( apptrack.connect() );
Apptrack automatically serves the client-side javascript from the client route (mentioned in the options below) which, when included in a web page, will create an object named at
in the global namespace.
A top level option that may contain the following sub-options:
Below are the public methods that are provided for interfacing with the library:
To track any event, load Apptrack on the server and optionally include the client-side JavaScipt (default: /apptrack.js) in the HTML page. You can call the method log
available from both ends of the application stack, with a keyword for the action and any parameters attached to it.
.log(action, params);
An action can be any arbitrary string, but you should treat is as an identifier label. To be able to group events you should use the same action keyword.
The library does not try to define the structure of the parameters - it is left schema-less for simplicity, allowing the developer to send arbitrary data along with any action.
In addition to the above, Apptrack also stores if provided:
An object defining user data (ex. email, id etc.) to identify the source of the log
Request headers passed during the log event. This is mostly to record authenticity data and other metadata (ex. browser, location etc.)
Initiated by Makis Tracend ( @tracend )
Distributed through Makesites.org
Inspired by the analytics app by @srivastavarobin
Released under the Apache license, version 2.0