Skip to content

OPENi-ict/tracklet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tracking for the Cloudlet Platform

Piwik is the leading open source web analytics platform. It was designed to give valuable insights into website visitors, marketing campaigns etc., however, we have taken a different approach with it. We are utilising it's tracking & reporting APIs, along with it's sophisticated UI, but for the purpose of tracking each data request made against an OPENi users cloudlet. Each user will then have their own web-frontend login to view this information.

Plugins

All the functionality you see when you use Piwik is provided by Piwik Plugins. The core of Piwik (termed Piwik Core) only contains tools for those plugins. We have extended the functionality of Piwik to suit our needs through the development of several plugins

Dev Environment Usage

This tracking feature is currently under development and is subject to change. When you vagrant up the dev-env piwik will be running at 192.168.33.10:8888/piwik, but needs to be configured. There is a tutorial here.

Config

Create a config file config.js with the following structure, including your Piwik auth token, and the corresponding Piwik domain

var config = {};
config.piwik = {};
config.mysql = {};

config.piwik.token_auth = "";
config.piwik.domain = "http://127.0.0.1:8000/";

config.mysql.host = 'localhost';
config.mysql.user = 'piwik';
config.mysql.password = 'password';
config.mysql.database = 'piwik';
config.mysql.multipleStatements = 'true';


module.exports = config;

Then require both the tracklet package and the config file

var tracklet = require('tracklet');
var config = require('./config');
tracklet.config(config);

Usage

This module is basically a wrapper for the Piwik HTTP Tracking API. token_auth is the admin token, i.e. not the users individual token. The default view for a new user is no site access.

Create a new user, and site, and set the access correctly

tracklet.init({
   password: 'password',
   email: '[email protected]',
   cloudlet: 'philipsCloudletId',
   access: 'view'
});

Track a request

tracklet.track({
   cloudlet: 'someUsersCloudletID'
   app: 'chrome',
   company: 'google',
   object: 'someObjectID'
});

Delete a user & corresponding site

tracklet.remove({
   email: '[email protected]',
   cloudlet: 'philipsCloudletId'
});

Example of Running Instance

Below is what the dashboard will look like for users

About

Tracking for the cloudlet platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published