---
title: "Privacy and consent"
description: "What the browser SDK collects and what it never does, URL redaction, waiting for your users' consent, redacting more at ingest, and sampling."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Privacy and consent

The SDK collects what performance and error monitoring need, and nothing that identifies a
person unless you add it. Every field is listed in the [data reference](/observability/rum/data-reference).

## What's collected

| Category | What |
| --- | --- |
| Performance | Page-load phases, route changes, interactions, request timings, Web Vitals and long-task counts |
| URLs | The path and the query string, with sensitive parameters redacted. Fragments (`#…`) and user info are dropped |
| Browser | The browser, its version, the operating system, the device type (desktop, mobile or tablet) and the User-Agent string |
| Location | The approximate location: country, region and city |
| Session | A random session ID |
| Errors | The error's type, message and stack trace |
| Breadcrumbs | The last 50 events before an error: views, action names, requests (method, redacted URL, status, duration), and console errors and warnings truncated to 256 characters |
| User | A user ID, only if you call `setUser({ id })` |

## What isn't

- **IP addresses.** EZGH looks up the location when data arrives, then discards the address. It's
  never stored.
- **Cookies.** The SDK sets none. The session lives in `localStorage`, under the key `ezgh_rum_s`.
- **Form values and page text.** Action names come only from a `data-ezgh-action` attribute or
  `aria-label`, else the element's tag and ID: never its text.
- **Email addresses or names.** There's no field for them. `setUser` takes only an ID; use an
  opaque one.

## URLs

The values of these query parameters are replaced with `REDACTED` in the browser, before
anything is sent: `token`, `access_token`, `id_token`, `code`, `state`, `password`, `passwd`,
`secret`, `key`, `api_key`, `apikey`, `session`, `sessionid`, `auth`, `signature` and `sig`.
`redactQueryParams` adds names to the list:

```ts
init({ token: "ezgh_ct_…", release, redactQueryParams: ["invite", "reset_token"] });
```

To remove path segments, such as an account number in `/accounts/123456`, use
[`beforeSend`](/observability/rum/configuration#beforesend-recipes).

## Consent

To wait for your users' consent:

```ts
import { init, consent } from "@ezghcloud/rum";

init({ token: "ezgh_ct_…", release, trackingConsent: "pending" });
// later, when the user accepts:
consent.grant();
// and if they withdraw it:
consent.revoke(); // stops sending and clears the session
```

With `"pending"`, nothing is collected, stored or sent until `consent.grant()`. Call `init` with
`trackingConsent: "granted"` (the default) on later visits when you already have consent.

## Redact more at ingest

[Transform rules](/observability/transforms) apply to browser data as to any other, before it's
stored. For example, to drop `user.id` from an environment's browser logs and spans:

```txt title="logs · statements"
delete_key(log.attributes, "user.id")
```

```txt title="traces · statements"
delete_key(span.attributes, "user.id")
```

## Sampling

`sessionSampleRate` records a percentage of sessions, decided once per session: with `25`, a
quarter of your users' sessions are recorded, completely, and the rest send nothing.

## Location data

IP geolocation by [DB-IP](https://db-ip.com), licensed under
[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).

Source: https://docs.ezghcloud.com/observability/rum/privacy/index.mdx
