electron-analytics
v0.1.2
Published
Client module for the Electron Analytics platform by NeutrinoMetrics
Downloads
13
Maintainers
Readme
Electron App Analytics Client
Module for Electron apps to feed stats to NeutrinoMetrics analytics platform.
Installation
Using npm:
$ npm install electron-analytics --save
Usage
In your main process add the following script:
require("electron-analytics").init("<YOUR APP ID>");
You can get an auto-generated ID for your app here. Important *: Make sure the above line is in your Main Process! Check out the electron docs on Main Vs Renderer Process for more info.
Custom Events
After initializing neutrino instance, you can send your own custom events. Works on renderer or main process.
const EA = require('electron-analytics');
EA.send("CLICKED_RED_BUTTON");
Custom User ID
You can also optionally set your own Custom ID for your users; run this code after an user logs in. Works on renderer or main process.
const EA = require('electron-analytics');
EA.setCustomUserId("[email protected]");
Webpack
If you encounter errors bundling with webpack (in the renderer process), add the following entry to the webpack config file:
target:"electron-renderer"
For more info, check out the webpack config docs.
Development Mode
If you do not want to run electron-analytics during development, add the following node environment variable/value:
EA_DISABLE_IN_DEV=true;
Note *: when running in development, depending on your env setup and location of the electron module, the app name and version can vary.
Get App ID
In order to start feeding info in your app, generate an ID for your app here.
Support
You can email the team at NeutrinoMetrics for support at [email protected] or visit us at neutrinometrics.net