# @snowplow/browser-tracker

> Browser tracker for Snowplow

Latest version **4.10.2** (published 2026-09-09) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @snowplow/browser-tracker
pnpm add @snowplow/browser-tracker
yarn add @snowplow/browser-tracker
bun add @snowplow/browser-tracker
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.10.2 |
| Published | 2026-09-09 |
| First published | 2021-03-08 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 590 |
| Maintainers | cksnp, snowplow-analytics, cogsp |
| Keywords | tracking, web analytics, events, open source |

## Links

- npm: https://www.npmjs.com/package/@snowplow/browser-tracker
- Repository: https://github.com/snowplow/snowplow-javascript-tracker
- Homepage: http://bit.ly/sp-js
- Issues: https://github.com/snowplow/snowplow-javascript-tracker/issues
- npm.io page: https://npm.io/package/@snowplow/browser-tracker

## Dependencies (3)

- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [@snowplow/tracker-core](https://npm.io/package/@snowplow/tracker-core.md) 4.10.2
- [@snowplow/browser-tracker-core](https://npm.io/package/@snowplow/browser-tracker-core.md) 4.10.2

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 4.10.2 (latest) — 2026-09-09
- 4.1.1-dev.2 (react-native) — 2025-01-02
- 4.0.2-dev.1 (create_react_native_tracker) — 2024-11-07
- 4.0.0-beta.4 (next) — 2024-10-22
- 3.13.2-dev.0 (1185-id-service-option) — 2023-07-04
- 3.13.1-dev.0 (add-tracking-scenario-option-to-core) — 2023-06-22
- 4.10.1 — 2026-08-19
- 4.10.0 — 2026-07-27
- 4.9.0 — 2026-07-21
- 4.8.4 — 2026-07-02
- 4.8.3 — 2026-06-30
- 4.8.2 — 2026-06-17
- 4.8.1 — 2026-05-13
- 4.8.0 — 2026-04-28
- 4.7.0 — 2026-04-01
- … 90 more at https://npm.io/package/@snowplow/browser-tracker/versions

## README

# Snowplow Browser Tracker

[![npm version][npm-image]][npm-url]
[![License][license-image]](LICENSE)

Add Snowplow Tracking to your Web Application with `@snowplow/browser-tracker`.  

## Maintainer quick start

Part of the Snowplow JavaScript Tracker monorepo.  
Build with [Node.js](https://nodejs.org/en/) (18 - 20) and [Rush](https://rushjs.io/).

### Setup repository

```bash
npm install -g @microsoft/rush 
git clone https://github.com/snowplow/snowplow-javascript-tracker.git
rush update
```

## Package Installation

With npm:

```bash
npm install @snowplow/browser-tracker
```

## Usage

Initialize your tracker with your desired configuration and optional plugins:

```js
import { newTracker } from '@snowplow/browser-tracker';
import { SiteTrackingPlugin } from '@snowplow/browser-plugin-site-tracking';
import { PerformanceTimingPlugin } from '@snowplow/browser-plugin-performance-timing';
import { ClientHintsPlugin } from '@snowplow/browser-plugin-client-hints';
import { FormTrackingPlugin, enableFormTracking } from '@snowplow/browser-plugin-form-tracking';

newTracker('sp1', '{{collector}}', { plugins: [ PerformanceTimingPlugin(), SiteTrackingPlugin(), ClientHintsPlugin(), FormTrackingPlugin() ] }); // Also stores reference at module level
newTracker('sp2', '{{collector}}', { plugins: [ PerformanceTimingPlugin(), SiteTrackingPlugin() ] }); // You can have multiple trackers with different configs!

enableFormTracking() // Switch on form tracking

```

Then use the `trackX` functions from this package and your plugins to track to all trackers which have been initialized, or select just some trackers:

```js
import { trackPageView } from '@snowplow/browser-tracker';
import { trackSocialInteraction } from '@snowplow/browser-plugin-site-tracking';

trackPageView({}, ['sp1']); // Just to `sp1`

// OR to all trackers with some extra context!
trackPageView({
  title: 'My Title',
  context: [
    {
      schema: 'iglu:org.schema/WebPage/jsonschema/1-0-0',
      data: {
        keywords: ['tester'],
      },
    },
  ],
});

// Use your plugin track methods too
trackSocialInteraction({
  action: 'retweet',
  network: 'twitter',
  target: '1234',
});


```

## Copyright and license

Licensed and distributed under the [BSD 3-Clause License](LICENSE) ([An OSI Approved License][osi]).

Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang.

All rights reserved.

[npm-url]: https://www.npmjs.com/package/@snowplow/browser-tracker
[npm-image]: https://img.shields.io/npm/v/@snowplow/browser-tracker
[docs]: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-tracker/
[osi]: https://opensource.org/licenses/BSD-3-Clause
[license-image]: https://img.shields.io/npm/l/@snowplow/browser-tracker

---
_Source: https://npm.io/package/@snowplow/browser-tracker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
