Client module for the Electron Analytics platform by NeutrinoMetrics
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
utils
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
config.js
index.js
package.json

README.md

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("Jane.Smith@gmail.com");

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 info@neutrinometrics.net or visit us at neutrinometrics.net