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.

post/v1/projects/{project_id}/zoning/zone-metrics

Authorizations

Authorizationstringrequired

http

Path parameters

project_idstringrequired

Amplitude project identifier, backed by the canonical app ID.

Example:12345
Constraints:pattern: ^[0-9]+$

Body

application/json
page_urlstringrequired

Page 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.

Example:https://example.com/pricing
Constraints:min length: 1max length: 2048
url_matchstring

How page_url is matched against the page URL recorded on each event. is matches the exact URL; contains matches any URL containing it.

Allowed values:iscontains
Default:is
time_rangeobject
Show child attributes
startstringrequired

Inclusive start date (project timezone unless timezone is set on query).

Constraints:format: date
endstringrequired

Inclusive end date.

Constraints:format: date
metricstring

Metric 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.

Allowed values:click_rate_pageviewclick_rate_sessionrage_click_rate_pageviewrage_click_rate_sessionclick_distributionclick_recurrencerage_click_recurrenceexposure_rateattractiveness_raterevenue_per_click
Default:click_rate_pageview
zone_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.

limitinteger

Maximum number of zones returned after ranking by value.

Default:20
Constraints:min: 1max: 200

Response

application/json
200· Zone metrics computed successfully.
dataobjectrequired

One metric for every zone on a page, ranked by value descending. Results reflect the caller's data access.

Show child attributes
idstringrequired

Identifier for this computation.

objectstringrequired

Resource-type discriminator. Always zone_metrics.

project_idstringrequired
Constraints:pattern: ^[0-9]+$
page_urlstringrequired

The page URL after normalization.

url_matchstringrequired

How page_url is matched against the page URL recorded on each event. is matches the exact URL; contains matches any URL containing it.

Allowed values:iscontains
Default:is
metricstringrequired

Metric 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.

Allowed values:click_rate_pageviewclick_rate_sessionrage_click_rate_pageviewrage_click_rate_sessionclick_distributionclick_recurrencerage_click_recurrenceexposure_rateattractiveness_raterevenue_per_click
Default:click_rate_pageview
time_rangeobjectrequired
startstringrequired

Inclusive start date (project timezone unless timezone is set on query).

Constraints:format: date
endstringrequired

Inclusive end date.

Constraints:format: date
timezonestringrequired

IANA timezone used to resolve time_range day boundaries (the project timezone).

zone_countintegerrequired

Number of zones returned.

Constraints:min: 0
total_zone_countintegerrequired

Number of zones with data before limit was applied.

Constraints:min: 0
truncatedbooleanrequired

true when total_zone_count exceeds zone_count.

zonesobject[]required
zone_idstringrequired

CSS selector identifying the zone.

valuenumberrequired

The metric value for this zone. Rates are fractions and are returned uncapped.

warningsstring[]required

Non-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.

これは役に立ちましたか?

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.