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

# What we collect

> The fields that the Web SDK sends, what the collector derives, how country is found on the server, which cookies the SDK sets, and what it never stores.

## What the SDK sends

Each event in `POST /v0/events` has these fields:

| Field | Description |
| - | - |
| `type` | `page`, `track` or `identify` |
| `event` | The event name (`track` only) |
| `message_id` | A unique ID for deduplication |
| `channel` | Always `web` for the Web SDK |
| `version`, `original_timestamp` | SDK envelope version and event time |
| `anonymous_id` | The persistent visitor ID. Absent before consent in [consent mode](https://docs.manalens.dev/guides/consent.md). |
| `session_id` | The client session ID |
| `user_id` | Set after `identify()` |
| `properties` | Your custom event properties |
| `traits` | User traits (`identify` only) |
| `context` | Page path, title and URL, external referrer, locale, campaign fields, and `library_name` and `library_version` |

A browser that opens a link from your game (the Godot SDK's `link_url()` or the Unity SDK's `LinkUrl()`) also sends one `identity_handoff` event with the game's anonymous ID (`source_anonymous_id`) and the link time (`handoff_at`). The SDK removes the `ua_hid` parameter from the address bar first.

## Page URLs

The SDK sends only the URL origin and path. It removes query strings and fragments. It keeps only the allowlisted campaign fields below, and it drops unsafe values. Each value is at most 255 characters.

## Campaign and ad parameters

| Group | Fields |
| - | - |
| Campaign | `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content` |
| Extended campaign | `utm_id`, `utm_source_platform`, `utm_creative_format`, `utm_marketing_tactic` |
| Google | `gclid`, `gbraid`, `wbraid`, `gad_source` |
| Meta | `fbclid` |
| Microsoft | `msclkid` |
| TikTok | `ttclid` |
| X | `twclid` |
| LinkedIn | `li_fat_id` |
| Reddit | `rdt_cid` |
| Snapchat | `ScCid` |
| Referral | `ref`. The aliases `referral` and `referral_code` become `ref`. |
| Referrer | The external origin only, or an Android app referrer such as `android-app://com.google.android.youtube` |

Arbitrary query parameters never enter the event. Do not put private data in campaign names or click IDs. See [attribution](https://docs.manalens.dev/attribution/overview.md) for how these fields become channels.

## What the collector derives

| Field | How |
| - | - |
| Country | An in-memory lookup of the visitor's IP address in Cloudflare's published geofeed (for Cloudflare ranges such as WARP), then the DB-IP country database. The IP address is then discarded. |
| Device, OS, browser | Parsed from the user agent. Known bots get the device `bot`. |
| Channel | The acquisition channel, such as Organic Search or Paid Social |

IP geolocation by [DB-IP](https://db-ip.com) (CC BY 4.0).

## Server-side geolocation

The collector sets the country on the server. The SDK does not send a location, and the browser asks for no location permission.

* **Country only.** The collector keeps an ISO 3166-1 alpha-2 code, such as `US` or `DE`. It never derives or stores a region, a city or coordinates.
* **In memory.** The lookup uses local databases on the collector: Cloudflare's published geofeed first, then DB-IP. No IP address is sent to a lookup service, and the address is discarded after the lookup.
* **Behind a [reverse proxy](https://docs.manalens.dev/guides/reverse-proxy.md).** The collector looks up the first public address in `X-Forwarded-For`, so the country is the visitor's, not your proxy's. Your proxy can also send `X-Visitor-Country` to set the country itself.
* **Server events.** The request comes from your backend, so the collector does not use its IP address. Send the player's `ip` or `country` in `context`. See [server events](https://docs.manalens.dev/sdks/server.md).
* **Unknown.** When no country can be found, the country is `ZZ`.

## Cookies and consent

> [card] First-party only
>
> No third-party cookies, no cross-site tracking and no fingerprinting.

* The Web SDK sets only **first-party** cookies on your own domain. They are listed in [browser storage](#browser-storage) below.
* The collector sets **no cookies**. Its responses have no `Set-Cookie` header.
* The SDK does **not read or set third-party cookies**, and the visitor ID is not shared with other sites or with advertising networks.
* The visitor ID is a random value. It is never derived from the IP address, the user agent or other request data.

Some privacy laws (for example the ePrivacy Directive in the EU and the UK) can require consent before a site stores an analytics identifier on a device, even in a first-party cookie. If your site needs consent, turn on [consent mode](https://docs.manalens.dev/guides/consent.md):

* Until the visitor gives consent, the SDK reads and writes **no cookies and no `localStorage`**. Page views and events are still sent, without a visitor ID, session ID or user ID.
* After `setConsent(true)`, the SDK stores the visitor ID and the session ID.
* After `setConsent(false)`, the SDK removes them.

Visitors can also opt out completely with `optOut()`. See [consent](https://docs.manalens.dev/guides/consent.md#opt-out).

> [!NOTE]
>
> Whether your site needs a consent banner is a decision for you and your legal advisers. Consent mode gives you the technical control.

## What we never store

* **IP addresses.** The collector uses the IP for the country lookup in memory. It does not store it, log it or send it to the database. For projects with a game, [install attribution](https://docs.manalens.dev/attribution/installs.md) also keeps a keyed hash of the IP for 72 hours, then deletes it. You can turn that off. The SDKs also send the clock's offset from UTC (`utc_offset`) for this match; it is not stored on events.
* **Raw user agents.** Only the derived device, OS and browser are kept.
* **Full URLs.** Query strings and fragments are removed.
* **Fingerprints.** No visitor ID is derived from request data.

## Browser storage

The Web SDK stores these first-party values. The key prefix is `ua_` plus a hash of the Publishable key.

| Key suffix | Where | Lifetime | Purpose |
| - | - | - | - |
| `anonymous-id` | Cookie, else `localStorage`, else memory | 1 year, refreshed on each event | Persistent visitor ID |
| `session-id` | Cookie, else `localStorage`, else memory | 30 minutes of inactivity | Session ID |
| `user-id` | Cookie (browser session) | Until the browser closes or `reset()` | `user_id` set by `identify()` |
| `opt-out` | Cookie and `localStorage` | 1 year | Set by `optOut()` |

By default, cookies use the apex domain (for example `.example.com`), so `example.com` and `app.example.com` share one visitor ID. Set `crossSubdomainCookies: false` (or `data-cross-subdomain="false"`) for host-only cookies.

## Data ownership

Custom properties and traits are data that you send. Keep private data out of event names, properties and campaign fields unless you need it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.