fastmon Docs
Analytics

Rank the elements behind LCP, CLS and INP

Fehler melden

Rank the attributed elements (CSS selector paths) for lcp / cls / inp.

Authentifizierung

bearerAuth
headerAuthentifizierungBearer <fm_… / fmo_…>

API token generated from the fastmon dashboard (Account → API Token) or at organization level (fmo_…, one that outlives its creator). Send as Authorization: Bearer fm_... or paste the full token (including its prefix) into the Authorize dialog.

Pfad-Parameter

org_id*Org Id
Formatuuid

Request-Body

application/json
  1. body

Request for the element-targets breakdown (migration-053 selector paths).

Generic over the three attributed vitals: which ELEMENT is the LCP / the largest layout shift / the reported INP interaction target. The selector columns are deliberately not query-builder dimensions (high-cardinality GROUP BY hazard); this endpoint ranks them via a bounded-state topK instead.

time_range*

Time range for the query (required)

filters?

Optional filters

metric*ElementTargetMetric

Which vital's element attribution to rank

Value in"lcp""cls""inp"
by?By

'element' ranks the CSS selector path; 'resource_url' ranks the LCP resource URL (only valid for metric='lcp')

Default"element"
Value in"element""resource_url"
group_by?Group By

'url', 'page_type' or 'device_type' ranks targets per value of that column. 'none' ranks them over the whole scope

Default"none"
Value in"none""url""page_type""device_type"
target?|

Keep only the pageviews whose ranked column is exactly this value: the selector, or with by='resource_url' the LCP resource URL. Takes the target of an item. With a group_by the top groups are then those of this element

limit?Limit

Top-N targets per group

Range1 <= value <= 25
Default10
groups_limit?Groups Limit

Top-N groups by attributed pageviews, for a group_by

Range1 <= value <= 50
Default20

Response-Body

Successful Response

application/json
  1. response

Response for the element-targets breakdown.

meta*

Facts about the result

request*

The request as the server resolved it

metric*ElementTargetMetric

The requested vital

Value in"lcp""cls""inp"
groups*array<>

group_by=none → exactly one group; any other group_by → the top groups

POST
/organizations/{org_id}/analytics/element-targets
Example Request
curl -X POST 'https://api.fastmon.eu/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/analytics/element-targets' \  -H 'Content-Type: application/json' \  -d '{  "time_range": {    "from": "2019-08-24T14:15:22Z",    "to": "2019-08-24T14:15:22Z"  },  "metric": "lcp"}'
Example Response
{  "meta": {    "execution_time_ms": 0,    "total": 0,    "limit": 0,    "offset": 0,    "has_more": true,    "next_cursor": "string",    "sampling": {      "sampling_rate": 0,      "is_sampled": true,      "estimated_metrics": [        "string"      ]    },    "is_identity_mixed": true,    "complete_until": "2019-08-24T14:15:22Z"  },  "request": {    "time_range": {      "from": "2019-08-24T14:15:22Z",      "to": "2019-08-24T14:15:22Z"    },    "comparison_time_range": {      "from": "2019-08-24T14:15:22Z",      "to": "2019-08-24T14:15:22Z"    },    "granularity": "minute",    "identity": "stitch",    "window_seconds": 0,    "filters": {},    "url_param_key": "string"  },  "metric": "lcp",  "groups": [    {      "key": "string",      "pageviews_with_target": 0,      "targets": [        {          "target": "string",          "count": 0,          "share": 0,          "avg_value": 0,          "distribution": {            "p50": 0,            "p75": 0,            "p90": 0,            "p95": 0,            "count": 0          },          "first_seen_at": "2019-08-24T14:15:22Z",          "example_url": "string",          "avg_lcp_ttfb": 0,          "avg_lcp_load_delay": 0,          "avg_lcp_load_duration": 0,          "avg_lcp_render_delay": 0,          "lcp_discovered_via": "preload",          "image_rate": 0,          "fetch_priority_high_rate": 0,          "lazy_rate": 0,          "cache_rate": 0,          "resource_url": "string",          "resource_url_count": 0        }      ]    }  ]}