Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amplitude-js

Package Overview
Dependencies
Maintainers
8
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amplitude-js

Javascript library for Amplitude Analytics

  • 8.21.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
189K
decreased by-24.83%
Maintainers
8
Weekly downloads
 
Created

What is amplitude-js?

The amplitude-js npm package is a JavaScript library for integrating Amplitude's analytics platform into web applications. It allows developers to track user interactions, events, and behaviors to gain insights into user engagement and product usage.

What are amplitude-js's main functionalities?

Initialize Amplitude

This feature initializes the Amplitude instance with your API key, allowing you to start tracking events and user interactions.

const amplitude = require('amplitude-js');
amplitude.getInstance().init('YOUR_API_KEY');

Track Events

This feature allows you to log custom events with optional event properties. It helps in tracking specific user actions within your application.

amplitude.getInstance().logEvent('EVENT_NAME', { key: 'value' });

Identify Users

This feature sets a unique user ID for tracking individual users. It is useful for identifying and analyzing user-specific behaviors.

amplitude.getInstance().setUserId('USER_ID');

Set User Properties

This feature allows you to set custom properties for a user, which can be used for segmentation and more detailed analysis.

amplitude.getInstance().setUserProperties({ key: 'value' });

Revenue Tracking

This feature enables revenue tracking by logging transactions and purchases, helping you understand the financial impact of user actions.

const revenue = new amplitude.Revenue().setProductId('PRODUCT_ID').setPrice(9.99);
amplitude.getInstance().logRevenueV2(revenue);

Other packages similar to amplitude-js

Keywords

FAQs

Package last updated on 27 Apr 2023

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