Concepts

The six words the rest of the Analytics reference assumes: Project, event, person, group, session and Source, and what each one is in the data.

Analytics has a small vocabulary. Six words carry almost everything, and most integration mistakes are one of them being read as something else. This page defines them against the data as it is actually stored, so the rest of the reference can be terse.

Project

A Project is one isolated event space. It has an id (acme-shop), a name, a plan, a settings object, members, credentials and a monthly quota, and it owns its own database on the analytics server.

Isolation is not a filter. A Project's events, people, sessions, reports, boards, cohorts and definitions live in a separate database, and the connection itself is chosen by the credential. Nothing in a report can reach another Project, because there is no join that could.

The credential decides the Project, always. The x-analytics-project header can name a Project, but it can only agree with the credential: a mismatch is a 403, and it can never redirect a write somewhere else.

Our own product runs as two Projects, prod and staging, on exactly this mechanism.

Event

An event is one thing that happened, at one moment, to one person. It is the only unit that is written.

{
  "id": "b0e1d2c3-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
  "ts": "2026-09-28T09:15:00.000Z",
  "event": "Order Paid",
  "uid": "user_1024",
  "aid": "anon_9f2c41",
  "sid": "sess_51ab",
  "url": "https://shop.example.com/checkout/thanks",
  "props": { "revenue": 42.5, "currency": "GBP", "items": 3 },
  "sp": { "utm_source": "newsletter" },
  "source": "web"
}
  • id is yours and is the idempotency key. A repeated id inside a batch is dropped, and the insert is idempotent on it, so retries are safe.
  • ts is when it happened, not when it was sent.
  • event is the name. Names keep their spaces, so Order Paid and order.paid are both fine, and the two are different events.
  • props are the event's own properties: scalars only, at most 40 per event.
  • sp are session properties (campaign attribution, landing page). Known keys become columns, the rest are kept as properties.

Names beginning with $ are reserved and the service acts on them. See Reserved events.

Person: anonymous id, user id, distinct id

Three identifiers, and knowing which one a report groups by saves a lot of confusion.

The stored distinct_id is derived on the way in: an explicit did if a trusted writer sent one, otherwise uid, otherwise aid. An event with none of the three is dropped; there is nobody to attribute it to.

A Project token is an untrusted writer, so a did it sends is stripped and the derivation applies. That is deliberate: a browser-side credential cannot claim to be an arbitrary person.

identify is what turns an anonymous history into a person's history. See Identity and merge.

Group

A group attaches events to an organisation rather than an individual: a company, a workspace, a shop. A group is a pair, group_key (which kind of group, for example company) and group_id (which one).

POST /v1/group records the pair for a person. From then on their events in the same batch carry it, and the group itself accumulates traits, a first-seen and a last-seen. A Project declares the group keys it uses in its settings, at most 10 of them.

Session

A session is a run of one person's activity with no long gap in it. Sessions are derived on our side from the events you send; you do not create them. sid on an event lets a client keep its own session boundary, which is what the web client does.

Source

Source is where an event came from: web, mobile, server, email or extension. A trusted writer sets it; a Project token may claim only web, extension or mobile (anything else is stored as web), so it cannot label browser traffic as server traffic.

Source is why the same event name can mean two things, and why the Sources panel in Project settings is the fastest way to see that an integration stopped sending.

How a write travels

Worth knowing, because it explains both the 204 and the small delay before an event is queryable:

  1. Validate. At most 50 events, scalars only, names and ids within their caps. Anything invalid is dropped from the batch, never fails it.
  2. Guard. Rate limit per key, then the Project's monthly quota.
  3. Publish. The batch goes to a durable log and the call returns 204. If the log is briefly unavailable the batch is written to a local journal, never lost, and never an error for you.
  4. Consume. A consumer enriches the events (user agent, country, session) and commits them to the Project's database, acknowledging only after the commit. Reserved events do their work here: identity merges, profile updates, group upserts.
  5. Count. Usage for the month is incremented after the commit, which is why the quota counts what was stored rather than what was posted.

The Live view is fed at step 3, so it shows an event before it is queryable. That is what makes it the right verification tool: it separates "did it reach us" from "is it in a report yet".

What is not a Project

Two words that mean something else here:

  • Environment. prod and staging are two Projects of ours, not a dimension of your Project. Keep your own environments as separate Projects if you want them separate at all.
  • Source is not a Project. One Project usually has several: a website, a backend, a Shopify store.

Next