# tracking-params

> Easily get and remove unwanted tracking parameters from URLs.

Latest version **0.2.2** (published 2020-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install tracking-params
pnpm add tracking-params
yarn add tracking-params
bun add tracking-params
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2020-10-11 |
| First published | 2020-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 46.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | dczysz |
| Maintainers | dczysz |
| Keywords | parameters, query, querystring, referral, tracking, url, utm |

## Links

- npm: https://www.npmjs.com/package/tracking-params
- Repository: https://github.com/dczysz/tracking-params
- Issues: https://github.com/dczysz/tracking-params/issues
- npm.io page: https://npm.io/package/tracking-params

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2020-10-11
- 0.2.1 — 2020-10-07
- 0.2.0 — 2020-10-07
- 0.1.3 — 2020-10-05
- 0.1.2 — 2020-10-05
- 0.1.1 — 2020-10-05
- 0.1.0 — 2020-10-05

## README

# Tracking Params ![Build Status](https://img.shields.io/github/workflow/status/dczysz/tracking-params/CI) ![Bundle Size](https://img.shields.io/bundlephobia/min/tracking-params)

Easily get and remove unwanted tracking parameters from URLs.

This project was inspired by [neat-url](https://www.npmjs.com/package/neat-url), but includes more functionality by returning detailed info along with the cleaned URL.

## Installation

```bash
npm install tracking-params
```

## Usage

```js
const { cleanUrl, getTrackingData } = require('tracking-params');

const url = 'https://example.com?ok=ok';
const dirtyUrl = url + '&utm_term=term';

console.log(cleanUrl(url));
// 'https://example.com?ok=ok'

console.log(cleanUrl(dirtyUrl));
// 'https://example.com?ok=ok'

console.log(getTrackingData(url));
// {
//   url: 'https://example.com?ok=ok',
//   isDirty: false,
//   trackingParams: [],
//   cleanUrl: 'https://example.com?ok=ok'
// }

console.log(getTrackingData(dirtyUrl));
// {
//   url: 'https://example.com?ok=ok&utm_term=term',
//   isDirty: true,
//   trackingParams: [
//     { key: 'utm_term', value: 'term' }
//   ],
//   cleanUrl: 'https://example.com?ok=ok'
// }
```

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