![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
electron-google-analytics
Advanced tools
The main purpose of this was to be used with Electron built apps.
Installation
npm i electron-google-analytics
Init
Analytics(trackingID, { userAgent, debug, version })
import Analytics from 'electron-google-analytics';
const analytics = new Analytics('UA-XXXXXXXX-X');
Pageview
Analytics#pageview(hostname, url, title, clientID)
return analytics.pageview('http://example.com', '/home', 'Example')
.then((response) => {
return response;
}).catch((err) => {
return err;
});
If you want to keep the session you need to specify the clientID
.
Event
Analytics#event(evCategory, evAction, { evLabel, evValue, clientID })
return analytics.event('Video', 'play', { evLabel: 'holiday', evValue: 300})
.then((response) => {
return response;
}).catch((err) => {
return err;
});
Screenview
Analytics#screen(appName, appVer, appID, appInstallerID, screenName, clientID)
return analytics.screen('test', '1.0.0', 'com.app.test', 'com.app.installer', 'Test')
.then((response) => {
return response;
}).catch((err) => {
return err;
});
Send (for everything else for now)
Analytics#send(hitType, params, clientID)
return analytics.send('social', { sa: 'social', sn: 'facebook', st: 'home' })
.then((response) => {
return response;
}).catch((err) => {
return err;
});
cross-env TRACKING_ID='UA-XXXXXXXX-X' npm test
FAQs
A library to implement Google Analytics in desktop apps.
We found that electron-google-analytics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.