More in Product analytics
- Autocapture and the AI event inbox
- Build a funnel that explains drop-off
- Identify users across web, app and mini-programs
- What is autocapture, and how does it work?
- How do I review and accept events in the inbox?
- What are unplanned events, and how do I manage them?
- When should I use a funnel instead of a goal or path?
- How do I build a funnel?
- How do I read where a funnel drops off?
- What is identified mode, and should I turn it on?
- How do I call login to identify a user?
- How is one person merged across devices?
- How does identity work on apps and mini-programs?
- How do I track clicks on outbound links?
- How do I track file downloads?
- How do I track form submissions?
- How do I track custom events?
- How do I track button clicks?
- How do I create a heatmap?
- How do I track scroll depth?
- How do I track ecommerce purchases and revenue?
- How do I set up goals and track conversions?
- How do I query my data with SQL?
- How do I analyze accounts with groups?
- How do I connect AI agents with MCP?
- How do I ask the AI assistant about my data?
- How do I create user segments?
- How do I run an RFM analysis?
- How do I record and watch session replays?
- How do I analyze user paths?
- How do I build a retention report?
- How do I analyze how an event is distributed?
- How do I create a tracking plan?
- How do I view a user’s profile and activity?
- How do I read the lifecycle report (new, returning, resurrecting, dormant)?
- How do I compare attribution models for a conversion?
- All guides in this category
Still have a question?
Could not find it? A person reads every message, usually within a few hours on business days.
Chat with usShort answer
Open All-platform analytics › Behavior › Metrics & SQL and create a metric: a built-in, an event with an aggregation, or a formula using TOTALS, UNIQUES, AVERAGE, ACTIVE, PROPSUM, PROPAVG or {id} of a saved metric. Choose a format, save, and pick it in any analysis or dashboard.
Short answer
Open All-platform analytics › Behavior › Metrics & SQL and create a metric. Choose a built-in metric, an event with an aggregation, or a formula that combines them. Set the format (number, percent, duration or currency) and save. The saved metric can then be picked in any analysis and placed on dashboards, so the whole team uses the same definition.
The three kinds
| Kind | What it is | Example |
|---|---|---|
| Built-in | A standard measure | Active people |
| Event + aggregation | One event, aggregated one way | purchase, property sum of revenue |
| Formula | Arithmetic over aggregations and saved metrics | Buyers ÷ active people |
Event aggregations: total, uniques, average per subject, active percent, sessions, first time, and on a property: sum, average, median, 90th percentile, distinct count, min and max.
Write a formula
Formulas use arithmetic, constants and these functions: TOTALS, UNIQUES, AVERAGE, ACTIVE, PROPSUM, PROPAVG, plus {id} to reference a saved metric.
Example, a paying rate: save "Buyers" as the purchase event with uniques, note its id (say 12), then create a formula metric {12} / ACTIVE and set the format to percent.
A formula may reference saved metrics that are not formulas; referencing another formula metric is rejected.
Filters and identity
A metric can carry its own filters (for example only country = US) and its own identity (person, visitor or account). Leave identity empty and it follows the analysis that uses it.
Check and reuse
- The editor previews the last 28 days as a trend before you save.
- In an analysis, pick the saved metric as a measurement. An analysis holds up to 12 measurements, and a saved metric uses one.
- The metric list shows how many places reference each metric.
Common questions
Can I delete a metric that is in use? You will be asked to confirm; forcing it breaks the analyses that reference it.
Why can a teammate not use my metric? Members with hidden properties cannot use a metric that references those properties.
Can I alert on a custom metric? Start from monitors; see set up traffic alerts.
For questions a metric cannot express, query your data with SQL.
Did this answer your question?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.