Custom metrics
Use it for ratios the team looks at often, such as buyers over active people. A metric that exists only on one chart is Event analysis; putting it on a board is Save, dashboards & share.
ConsoleAll-platform analyticsBehaviorMetrics & SQLHow to configure
A metric is a built-in, an event plus an aggregation, or a formula. Event aggregations match event analysis: total, uniques, average per subject, active percent, sessions, first time, and property sum, average, median, 90th percentile, distinct count, min, and max. The metric can carry its own filters and its own identity; omit identity and it follows the analysis that uses it. Format is number, percent, duration, or currency.
A formula is arithmetic and constants. Use TOTALS, UNIQUES, AVERAGE, ACTIVE, PROPSUM, PROPAVG, or {id} for a saved metric. A metric definition cannot itself be “a saved metric.” Put that reference in a formula. A formula can reference only saved metrics that are not formulas; referencing another formula metric is rejected.
How to read the result
The list shows kind, definition, and how many places reference it. The editor previews the last 28 days as a trend, even before you save. Saving a metric from the builder replaces that slot with a reference, so the definition is not copied twice.
Limits & definitions
Preview is always the last 28 days and does not use the compare period from the builder. An analysis holds at most 12 measurements, and a saved metric takes one slot. Ids in a formula must be metrics that already exist in this project. Deleting a metric that is still referenced asks for confirmation; forcing it breaks those analyses. A member with hidden properties is rejected when an analysis references one of them. Monitors that should use a metric start at Monitors & alerts. Creating a monitor from a chart point only stores a draft today.
SQL playground
Use it for a cross-tab or a one-off list the built-in models do not give you; the four views are already limited to this project. A file someone else should download later is an export job in Export, not this result grid.
ConsoleAll-platform analyticsBehaviorBehavior analysisThe Metrics & SQL menu item opens the metric library, Custom metrics. API Playground under Data tries statistics endpoints and does not run this SQL.
How to configure
Open the SQL tab. The statement runs on blur, or on Command-Enter or Ctrl-Enter. Only one SELECT or WITH is allowed. Comments, semicolons, backticks, writes, and system catalogs are rejected. The query must name at least one view:
| View | Scope | Contents |
|---|---|---|
v_events | This project and the selected time | Event columns, plus subject for the current identity |
v_sessions | This project, by session start | Duration, pages, channel, entry, and subject |
v_persons | This project, not cut by time | First and last seen, how they were identified, device count, properties, consent |
v_autocapture | This project and the selected time | Clicked elements, coordinates, scroll depth |
{filters} becomes the builder’s global filters, or a constant true when there are none. Return rewritten SQL shows the statement that actually ran, with project and time already filled in. Identity changes how subject is computed; see Measurement × Behavior. There is no breakdown control and no compare period. Comparing segments is rejected.
How to read the result
The result is a table. The footer is the row count, and it says when the result was truncated. You can expand the rewritten statement. CSV export uses these columns.
Limits & definitions
An outer limit returns at most 50,000 rows; one extra row detects truncation. Timeout is 30 seconds. The text can be at most 20,000 characters. A member with hidden properties (column scope) cannot run it. Real table names behind the views are rejected. The person view has no subject column, and {filters} only works on columns that view actually has.