# segmentio/analytics.js

The hassle-free way to integrate analytics into any web application.

Repository: https://github.com/segmentio/analytics.js
Canonical: https://ross.abutalabs.com/products/analyticsjs
Homepage: https://segment.com/libraries/analytics.js
Language: JavaScript
License: MIT
License Family: permissive
Archived: true
Last push: 2022-02-24T10:48:35+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 5189, "days_push": 1651, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4747, forks 722 (observed 2026-08-28T04:08:57.869707+00:00)

## What it is
Analytics.js is Segment's open-source JavaScript library for collecting customer event data in web applications and routing it to 250+ analytics and marketing tools through a single unified API. It is now superseded by Segment's Analytics Next (analytics-next) library.

## Use cases
- track user events in a web app and send them to multiple analytics tools
- integrate Google Analytics, Mixpanel, and Amplitude with one snippet
- collect customer data without writing per-vendor tracking code
- instrument product analytics funnels and retention metrics
- switch analytics vendors without changing tracking code

## When to choose
- you use Segment and need the classic analytics.js snippet for browser event collection
- you maintain a legacy integration already built on analytics.js

## When to avoid
- you are starting a new project - use segmentio/analytics-next instead
- you need server-side or mobile data collection
- you want a self-hosted analytics solution without Segment

## Facets
- artifact type: library
- maturity: maintenance
- function: analytics, sdk, http-client
- domain: analytics, web-development, frontend, developer-tools
- platform: browser
- tags: segment, customer-data, event-tracking, web-analytics, deprecated-in-favor-of-analytics-next, javascript, nodejs

## Member repositories
- segmentio/analytics.js (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:57.869707+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:18:56.294242+00:00, confidence not recorded.
  - readme: https://github.com/segmentio/analytics.js (fetched 2026-08-28T04:08:57.869707+00:00, sha 1532eba08032)
  - registry_npm: https://registry.npmjs.org/analytics.js (fetched 2026-08-29T09:02:42.410022+00:00, sha 22963796cb9c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
