Query zone metrics
Returns one metric for every zone on a page URL, ranked by value. A zone
is identified by the CSS selector of its element. Results reflect the
authenticated caller's project access and data access controls.
This POST computes a result and does not mutate state. It is therefore a
read operation and does not require an Idempotency-Key.
Omitting time_range uses the last 30 days in the project timezone. The
span of time_range cannot exceed 90 days.
/v1/projects/{project_id}/zoning/zone-metricsAuthorizations
Authorizationstringrequiredhttp
Path parameters
project_idstringrequiredAmplitude project identifier, backed by the canonical app ID.
12345pattern: ^[0-9]+$Body
application/jsonpage_urlstringrequiredPage URL to analyze. Accepts http and https URLs; a URL without a
scheme is treated as https. The query string and fragment are removed
before matching, so https://example.com/pricing?utm=x and
https://example.com/pricing are the same page.
https://example.com/pricingmin length: 1max length: 2048url_matchstringHow page_url is matched against the page URL recorded on each event.
is matches the exact URL; contains matches any URL containing it.
iscontainsistime_rangeobjectShow child attributes
startstringrequiredInclusive start date (project timezone unless timezone is set on query).
format: dateendstringrequiredInclusive end date.
format: datemetricstringMetric computed per zone. Rates are fractions (0.18 is 18%).
click_rate_pageview: page views with a click in the zone, divided by page views.click_rate_session: sessions with a click in the zone, divided by sessions.rage_click_rate_pageview: page views with a rage click in the zone, divided by page views.rage_click_rate_session: sessions with a rage click in the zone, divided by sessions.click_distribution: clicks in the zone, divided by all clicks on the page.click_recurrence: clicks in the zone, divided by page views. Can exceed 1.rage_click_recurrence: rage clicks in the zone, divided by page views. Can exceed 1.exposure_rate: page views where the zone was visible, divided by page views.attractiveness_rate: page views where the zone was visible and clicked, divided by page views where it was visible. Can exceed 1.revenue_per_click: revenue attributed to the zone, divided by sessions that clicked it, in the project's revenue unit.
click_rate_pageviewclick_rate_sessionrage_click_rate_pageviewrage_click_rate_sessionclick_distributionclick_recurrencerage_click_recurrenceexposure_rateattractiveness_raterevenue_per_clickclick_rate_pageviewzone_idsstring[]Restrict the result to these zones. A zone id is the CSS selector of
the element, as returned in zones[].zone_id. Omit to rank every zone
on the page.
limitintegerMaximum number of zones returned after ranking by value.
20min: 1max: 200Response
application/jsondataobjectrequiredOne metric for every zone on a page, ranked by value descending.
Results reflect the caller's data access.
Show child attributes
idstringrequiredIdentifier for this computation.
objectstringrequiredResource-type discriminator. Always zone_metrics.
project_idstringrequiredpattern: ^[0-9]+$page_urlstringrequiredThe page URL after normalization.
url_matchstringrequiredHow page_url is matched against the page URL recorded on each event.
is matches the exact URL; contains matches any URL containing it.
iscontainsismetricstringrequiredMetric computed per zone. Rates are fractions (0.18 is 18%).
click_rate_pageview: page views with a click in the zone, divided by page views.click_rate_session: sessions with a click in the zone, divided by sessions.rage_click_rate_pageview: page views with a rage click in the zone, divided by page views.rage_click_rate_session: sessions with a rage click in the zone, divided by sessions.click_distribution: clicks in the zone, divided by all clicks on the page.click_recurrence: clicks in the zone, divided by page views. Can exceed 1.rage_click_recurrence: rage clicks in the zone, divided by page views. Can exceed 1.exposure_rate: page views where the zone was visible, divided by page views.attractiveness_rate: page views where the zone was visible and clicked, divided by page views where it was visible. Can exceed 1.revenue_per_click: revenue attributed to the zone, divided by sessions that clicked it, in the project's revenue unit.
click_rate_pageviewclick_rate_sessionrage_click_rate_pageviewrage_click_rate_sessionclick_distributionclick_recurrencerage_click_recurrenceexposure_rateattractiveness_raterevenue_per_clickclick_rate_pageviewtime_rangeobjectrequiredstartstringrequiredInclusive start date (project timezone unless timezone is set on query).
format: dateendstringrequiredInclusive end date.
format: datetimezonestringrequiredIANA timezone used to resolve time_range day boundaries (the project timezone).
zone_countintegerrequiredNumber of zones returned.
min: 0total_zone_countintegerrequiredNumber of zones with data before limit was applied.
min: 0truncatedbooleanrequiredtrue when total_zone_count exceeds zone_count.
zonesobject[]requiredzone_idstringrequiredCSS selector identifying the zone.
valuenumberrequiredThe metric value for this zone. Rates are fractions and are returned uncapped.
warningsstring[]requiredNon-fatal conditions. Includes a warning when the numbers behind a rate were computed from differently aged cache snapshots, which can push a rate above its natural bound.
Was this helpful?
For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.