Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
electron-ga-uuid
Advanced tools
Readme
Google Analytics client for Electron applications with some useful built in features.
Forked from electron-ga. Changed to use a locally stored unique id, which can be reset if requested to comply with Google Analytics requirements. Also despite the inherited name, no longer depends on electron.
First create a Web Property in Google Analytics and add a Mobile App View. The Mobile App View is better suited to display analytics from Electron, including application version.
electron-ga-uuid works in the renderer process.
import Analytics from 'electron-ga-uuid';
const analytics = new Analytics('UA-XXXXXXXX-X');
In electron, for app name and app version, either use dotenv
with a .env
file to set them or pass them in at the constructor:
const analytics = new Analytics('UA-XXXXXXXX-X', { appName: packageJson.name, appVersion: packageJson.version });
Then:
await analytics.send('screenview', { cd: 'User List' });
await analytics.send('event', { ec: 'Scroll', ea: 'scrollto', el: 'row', ev: 123 });
electron-ga-uuid uses Google Analytics Measurement Protocol. You can add custom parameters or override any of them.
constructor
(trackId[, initParams])
The trackId
is a string and its format is: UA-XXXXXXXX-X
.
The initParams
is an object and its optional properties are:
You can set any of them with a constant string value or a getter function, that returns a string value:
const analytics = new Analytics('UA-XXXXXXXX-X', {
userId: '123456',
language: () => store.getState().language
});
send
(hitType[, additionalParams]) -> Promise
The hitType
is a string. You can find here the available values.
The additionalParams
is an object with any properties, which are acceptable by the Google Analytics Measurement Protocol.
resetClientId
()
Reset the Client ID if the user requests
import { resetClientId } from 'electron-ga-uuid';
resetClientId();
FAQs
Google Analytics client for Electron applications
The npm package electron-ga-uuid receives a total of 180 weekly downloads. As such, electron-ga-uuid popularity was classified as not popular.
We found that electron-ga-uuid 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.