Socket
Socket
Sign inDemoInstall

@segment/analytics-core

Package Overview
Dependencies
3
Maintainers
229
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@segment/analytics-core


Version published
Maintainers
229
Install size
372 kB
Created

Package description

What is @segment/analytics-core?

@segment/analytics-core is a core library for Segment's analytics tracking. It provides a set of tools to track user interactions, manage user identities, and send data to various analytics services.

What are @segment/analytics-core's main functionalities?

Track Events

The `track` method allows you to record any actions your users perform. It takes an event name and an optional properties object.

const Analytics = require('@segment/analytics-core');
const analytics = new Analytics();

analytics.track('User Signed Up', {
  plan: 'Pro Annual',
  accountType: 'Facebook'
});

Identify Users

The `identify` method lets you tie a user to their actions and record traits about them. It takes a user ID and an optional traits object.

const Analytics = require('@segment/analytics-core');
const analytics = new Analytics();

analytics.identify('userId123', {
  email: 'user@example.com',
  name: 'John Doe'
});

Group Users

The `group` method allows you to associate an individual user with a group, like a company or organization. It takes a group ID and an optional traits object.

const Analytics = require('@segment/analytics-core');
const analytics = new Analytics();

analytics.group('groupId123', {
  name: 'Segment',
  industry: 'Analytics'
});

Page Views

The `page` method lets you record page views on your website. It takes a page name and an optional properties object.

const Analytics = require('@segment/analytics-core');
const analytics = new Analytics();

analytics.page('Home', {
  title: 'Home Page',
  url: 'https://example.com/home'
});

Other packages similar to @segment/analytics-core

Readme

Source

Analytics Core

This package represents core 'shared' functionality that is shared by analytics packages. This is not designed to be used directly, but internal to analytics-node and analytics-browser.

FAQs

Last updated on 27 Nov 2022

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc