Skip to main content
Product analytics is coming soon. It is available on plans with product analytics. Until it launches, a project can use it only when early access is on for the project. Other projects get 403 with the code coming_soon (or plan_upgrade_required on a plan without product analytics). Call analytics.status to see the state of a project.
Product analytics reads the consented page views, custom events, and identify calls that the Browser SDK sends. The SDK removes query strings, fragments, and ID-like path segments before it sends an event, and Squasher keeps a country code, never an IP address.

Operations

Reads take period (24h, 7d, 30d, or 90d; default 7d) or from and to (ISO 8601, at most 90 days), and an optional environment. The overview compares each number with the previous period of the same length. Its breakdowns have the top values of page, entry_page, exit_page, referrer, channel, utm_source, utm_medium, utm_campaign, country, device, browser, and os. For channel, entry_page, and exit_page, the pageviews field of a row counts sessions. Call analytics.breakdown with breakdown=<key> and limit (1 to 100, default 100) to get more rows of one breakdown.

Filters

The overview, events, breakdown, live, properties, and goal conversion reads, the funnel run, and the funnel drop-off errors accept filters. A filter is dimension:value: Values match exactly. A referrer is a host name, for example news.ycombinator.com. A country is a two-letter code. A channel is one of Direct, Search, Social, Referral, Paid, Email, or Campaign. Filters on the same dimension match any of their values; filters on different dimensions must all match. Send at most 10. In a GET request, repeat the filter query parameter:
In a POST body, send "filters": ["channel:Search", "country:DE"]. A filter that keeps whole sessions keeps every event of those sessions, so session counts, bounce rate, and funnels stay correct.

How numbers are counted

  • Page views and event counts are exact: each event has an ID, and an event that arrives twice counts once.
  • Visitors are approximate unique anonymous IDs.
  • Sessions use the browser session ID that errors and session replays also use. A bounce is a session with one page view.
  • People in funnels: a visitor who called identify counts as the same person as every other visitor with that user ID.

Funnels

A step is a page view by path or an event by name:
Each step returns people, conversion_from_start, conversion_from_previous (percent), and dropped (people who did not reach the next step). median_seconds_from_previous and p90_seconds_from_previous are the median and 90th percentile time from the previous step, for the people who reached the step; they are null on the first step and when no one reached the step. Send funnel_id instead of steps to run a saved funnel, and filters to run the funnel on part of your traffic. To see what went wrong for people who dropped after a step, send the same steps to analytics.funnelDropoffErrors with step_index (0-based). The response lists the error groups in their sessions, the number of sessions with each error, sample session IDs for session replay, and the matching issue.

Goals

A goal is an event or a page that counts as a conversion. A project can have at most 50 goals; creating one more returns 409.
  • An event goal needs name (1 to 120 characters) and event_name (1 to 200 characters). property_key (letters, digits, _, $, ., -; at most 64 characters) and property_value (1 to 1024 characters) are optional, and you set them together.
  • A page goal needs name and path_pattern: a path that starts with /, where * matches any characters. Other characters match only themselves.
analytics.goalConversions returns, for each goal, conversions (approximate visitors who completed the goal), completions (matching events), and conversion_rate (percent of all visitors in the range), with the total visitors. It accepts the range and filters.

Live visitors, installation check, and properties

  • analytics.live returns visitors, pageviews, and top_pages for the last 5 minutes. It accepts environment and filters; it has no range.
  • analytics.installation shows whether events arrive. For the last 24 hours it returns event counts by kind, receiving, and the page hosts and environments that sent events. last_event_at is the newest event in the last 90 days, or null.
  • analytics.properties?event=<name> returns the property keys of that event with their event counts and their most common values. It accepts the range and filters.

AI crawler traffic

analytics.aiCrawlers reads the user_agent.original attribute of server spans. Each crawler row has a confidence:
  • user_agent: only the user agent matched. Anyone can send that user agent.
  • verified: every client address is in the operator’s published IP ranges.
  • mismatch: some client address is outside those ranges.
Squasher checks addresses only for operators that publish their IP ranges (today OpenAI and Perplexity). Other crawlers stay at user_agent. To check addresses, the span must carry the client.address attribute.

CLI and MCP

Repeat --filter dimension:value for more than one filter; the overview, events, breakdown, live, properties, goal conversions, funnel run, and drop-off errors commands accept it. In MCP Code Mode, call search("analytics") before you execute an operation. Send filters of a read as a list, for example query: { filter: ["channel:Search", "country:DE"] }.

Identity export and deletion

Pass exactly one distinct_id or account_id. Export responses contain at most 500 events and a next_cursor; send that cursor to continue. Deletion is safe to retry and records an organization audit event. These privacy operations are intentionally hidden from MCP Code Mode.

Agent handoff

Related: Browser SDK, Web Vitals API, Plans and billing.