Skip to main content
A query in Upstack has three parts. Measures are the numbers, such as orders.net_revenue. Dimensions break a measure into rows, such as one row per utm_source. Filters narrow the data first, such as only new customer orders. The ids on this page are the ones the analytics API and the CLI accept.

Measures

Every measure id starts with a group prefix. The group tells you where the data comes from and which dimensions can break it down. To see every measure you can pick, with its title and formula, call List available measures or run upstack measures. Need a number that isn’t there? Build it from these ids with Custom Measures. Money measures are converted to your reporting currency. See Reporting currency.

Dimensions

Send up to five dimension ids in dimensions on Run an analytics query. In a dashboard view, Group by offers Customer type and Order type. A dimension only breaks down measures whose data has that field. The Breaks down column says which. Pick dimensions that match your measures: a dimension the measure doesn’t have won’t split it, and with granularity none the measure can fail and come back with success: false.

Traffic dimensions

Visitor dimensions

Page and event dimensions

Order dimensions

Ad dimensions

EMQ dimensions

emq.dataset_id, emq.event_name and emq.event_source break down every emq. measure. emq.identifier, emq.issue_category, emq.dedupe_key, emq.data_freshness, emq.diagnostic_name and emq.severity each break down the EMQ measures they belong to, such as emq.diagnostic_name for diagnostics counts.

Other dimension ids

upstack dimensions also lists ids such as device_model, country_code and financial_status. The API accepts them, but no measure in the measure picker breaks down by them. Attribution queries take their own dimension: utm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_adset, utm_ad, utm_source_medium or utm_source_campaign.

Customer type

customer_type splits Shopify order measures into first orders and repeat orders. You can group by it as a dimension, or filter on it with the Customer type filter (field id orders.customer_type). The classification looks at the customer’s whole order history, not the date range you selected. The filter isn’t offered on LTV cohort views, where every cohort is already made of new customers.

Order type

order_type splits Shopify orders by subscription status, based on the order’s tags and source. Group by it, or filter with the Order type filter (field id orders.order_type). If your subscription app tags its orders differently, those orders count as one-time orders.

Filters

A filter field narrows the data before measures are calculated. Each field works in some places and not others, listed under Used in. List filter fields and upstack filters return the same set with every supported operator. query_measures is Run an analytics query and custom dashboards. The other values are listed under FilterContext in the API reference.

Combining measures and dimensions

Query Guide

Build queries, set date ranges, and apply filters.

Custom Measures

Define your own metrics from a formula over these measures.