> ## 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.

# Common fields

> Reference for the envelope fields that every event shares, the context fields that the SDKs send, and the fields that the collector adds.

Every event has the same envelope. The SDKs fill it in for you. The collector then adds derived fields to `context`.

## Envelope fields

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | String | Yes | `page`, `track` or `identify`. Billing providers add their own types. |
| `event` | String | `track` only | The event name, at most 128 characters |
| `message_id` | String | Yes | A UUID. Reports count each `message_id` once. Optional for server events: the collector makes one. |
| `channel` | String | Yes | The event origin: `web` (website), `app` (game or app build), `server` (backend), `stripe` or `paddle` (billing), `dashboard` (profile edit) |
| `version` | String | Yes | The envelope version that the SDK sends |
| `original_timestamp` | Timestamp | Yes | When the event happened, ISO 8601 in UTC |
| `received_at` | Timestamp | | When the collector received the event. The collector sets it. |
| `anonymous_id` | String | | The persistent visitor ID, a UUID. Empty before consent in [consent mode](https://docs.manalens.dev/guides/consent.md). |
| `session_id` | String | | The client session ID. Letters, digits and `_ . : -`, at most 64 characters. |
| `user_id` | String | | Your user ID, set after `identify`. At most 255 characters. |
| `context` | Object | Yes | Page or app context, campaign fields and derived fields. See below. |
| `properties` | Object | | Your custom properties. Flat; scalar values only. |
| `traits` | Object | `identify` only | User traits |

> [!NOTE]
>
> `channel` is where an event comes from. `channel_type` (in `context`) is the acquisition channel, such as Paid Search or Direct. Reports call `channel_type` **Channel**.

### Timestamps

* **Web events:** `original_timestamp` is the browser time.
* **App events:** `original_timestamp` can be up to 7 days old, so an offline queue can send later. Older events, or events more than 10 minutes in the future, refuse the batch.
* **Server events:** `original_timestamp` defaults to the time received. It can be at most 5 minutes in the future. Past times are accepted for backfills.

## Page context

Website events (`channel` `web`) have these `context` fields:

| Name | Description |
| - | - |
| `page.url` | The page origin and path, without query string or fragment |
| `page.path` | The path |
| `page.title` | The document title |
| `referrer` | The external referrer origin, or empty |
| `locale` | The browser locale, for example `en-US` |
| `library_name`, `library_version` | The SDK name and version |
| Campaign fields | `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, the extended UTM fields, click IDs and `ref`. See [what we collect](https://docs.manalens.dev/data/what-we-collect.md#campaign-and-ad-parameters). |

## App context

Game and app events (`channel` `app`) have `context.app` in place of `context.page`:

| Name | Description |
| - | - |
| `app.platform` | `windows`, `macos`, `linux`, `web`, `android`, `ios`, `other` |
| `app.storefront` | `steam`, `itch`, `epic`, `gog`, `app_store`, `play`, `other` |
| `app.app_version` | Your version string, at most 32 characters |
| `app.build` | Your build ID, at most 64 characters |
| `app.engine` | `godot`, `unity`, `unreal`, `other` |
| `locale`, `library_name`, `library_version` | As for web events |

An event has `context.page` or `context.app`, never both. See [App and game events](https://docs.manalens.dev/sdks/app-events.md#the-app-context).

## Derived fields

The collector adds these fields to `context`. It never stores the IP address or the raw user agent.

| Name | Description |
| - | - |
| `country` | ISO 3166-1 alpha-2 code from an in-memory IP lookup. `ZZ` is unknown. |
| `device` | `desktop`, `mobile`, `tablet` or `bot`. For a native app build, `desktop`, or `mobile` on Android and iOS. |
| `os`, `browser` | From the user agent. For a native app build, the OS comes from `app.platform`. |
| `channel_type` | The acquisition channel. App events are `Direct`. See [Attribution](https://docs.manalens.dev/attribution/overview.md). |
| `paid_source` | The ad network from a click ID, `gad_source` or a paid `utm_medium`, for example `google` or `paid_utm` |
| `click_id` | The first click ID found, such as `gclid` |

Server events get no derived fields from the request. Send `context.country`, `device`, `os`, `browser`, `locale` and `page` yourself. See [server events](https://docs.manalens.dev/sdks/server.md).

## Read fields with SQL

In the [Explorer](https://docs.manalens.dev/features/explorer.md), `context` and `properties` are JSON strings:

```sql theme={null}
SELECT
  JSONExtractString(context, 'channel_type') AS channel,
  JSONExtractString(context, 'app', 'build') AS build,
  JSONExtractString(properties, 'plan') AS plan
FROM raw_events
LIMIT 10
```


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