A simple utility that allows to track actions, items, whatever you need, on Electron based desktop apps
-
Put the Tracking.js file into your proyect folder, ideally into the root.
-
Import it into your main index.js file:
const Tracking = require("./Tracking");
- Init the component:
app.on("ready", () => {
Tracking.init();
// YOUR CODE HERE
})
- Finally import Tracking.js on your front-end js script and make tracking requests as follows:
const Tracking = require("../Tracking");
Tracking.trackRequest("slide", "default");
The 2 parameter that thsi method receives are: The name of the item you want to track, and the kind/type.
It creates a JSON storage file in the root of the app. And based on it, generates a human-readable tracking report in the user's desktop.