Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Understand how your tool is being used by anonymously reporting usage metrics to Google Analytics
Understand how your tool is being used by anonymously reporting usage metrics to Google Analytics or Yandex.Metrica
This module uses the newly released Universal Analytics API from Google Analytics
Displaying metrics from Yeoman which makes use of Insight.
Google Analytics
var Insight = require('insight');
var insight = new Insight({
// Google Analytics tracking code
trackingCode: 'UA-XXXXXXXX-X'
});
// ask for permission the first time
if (insight.optOut === undefined) {
return insight.askPermission();
}
insight.track('foo', 'bar');
// recorded in Analytics as `/foo/bar`
Yandex.Metrica
var Insight = require('insight');
var insight = new Insight({
// Yandex.Metrica counter id
trackingCode: 'XXXXXXXXX'
trackingProvider: 'yandex'
});
// ask for permission the first time
if (insight.optOut === undefined) {
return insight.askPermission();
}
insight.track('foo', 'bar');
// recorded in Yandex.Metrica as `http://<package-name>.insight/foo/bar`
or a live example
Type: string
Required
Your Google Analytics trackingCode or Yandex.Metrica counter id.
Type: string
Default: 'google'
Tracking provider to use
Possible values are 'google'
or 'yandex'
Type: string
Default: 'package.json'
Relative path to your module package.json
Type: string
Default: Inferred from packageFile
Used instead of inferring it from packageFile
Requires you to also specify packageVersion
Type: string
Default: Inferred from packageFile
Used instead of inferring it from packageFile
Requires you to also specify packageName
Type: object
Default: An instance of configstore
If you want to use your own configuration mechanism instead of the default
configstore
-based one, you can provide an object that has to implement two
synchronous methods:
get(key)
set(key, value)
Accepts keywords which ends up as a path in Analytics.
.track('init', 'backbone')
becomes /init/backbone
Asks the user for permission to track and sets the optOut
property. You can also choose to set this manually.
Optionally supply your own message
and callback
. The callback will be called with the arguments error
and optOut
when the prompt is done, and is useful for when you want to continue the execution while the prompt is running.
Returns a boolean whether the user has opted out of tracking. Should preferably only be set by a user action, eg. a prompt.
BSD license and copyright Google
FAQs
Understand how your tool is being used by anonymously reporting usage metrics to Google Analytics or Yandex.Metrica
The npm package insight receives a total of 85,912 weekly downloads. As such, insight popularity was classified as popular.
We found that insight demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.