Socket
Socket
Sign inDemoInstall

insight

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

insight

Understand how your tool is being used by anonymously reporting usage metrics to Google Analytics


Version published
Weekly downloads
120K
decreased by-4.06%
Maintainers
1
Weekly downloads
 
Created

What is insight?

The 'insight' npm package is used for tracking and reporting anonymous usage metrics for your Node.js applications. It helps developers understand how their tools are being used by collecting data such as command usage, version information, and other relevant metrics.

What are insight's main functionalities?

Tracking Usage

This feature allows you to track usage events in your application. The code sample demonstrates how to initialize the Insight instance, ask for user permission, and track an event.

const Insight = require('insight');
const pkg = require('./package.json');

const insight = new Insight({
  trackingCode: 'UA-000000-01',
  pkg
});

// Ask for permission the first time
if (insight.optOut === undefined) {
  insight.askPermission();
}

// Track an event
insight.track('event', 'category', 'action', 'label', 'value');

Opt-in/Opt-out Management

This feature allows you to manage user consent for tracking. The code sample shows how to check if the user has opted out of tracking.

const Insight = require('insight');
const pkg = require('./package.json');

const insight = new Insight({
  trackingCode: 'UA-000000-01',
  pkg
});

// Check if the user has opted out
if (insight.optOut) {
  console.log('User has opted out of tracking');
} else {
  console.log('User has opted in to tracking');
}

Custom Event Tracking

This feature allows you to track custom events specific to your application. The code sample demonstrates how to track a custom event with specific parameters.

const Insight = require('insight');
const pkg = require('./package.json');

const insight = new Insight({
  trackingCode: 'UA-000000-01',
  pkg
});

// Track a custom event
insight.track('customEvent', 'customCategory', 'customAction', 'customLabel', 'customValue');

Other packages similar to insight

Keywords

FAQs

Package last updated on 22 Jun 2013

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc