文件
APIAPI 參考

事件

自訂事件的彙總、時間序列、搜尋、事件類型與欄位。

POST/api/v1/sites/{siteId}/analytics/events/summary

取得事件摘要

Returns totals for custom events in the range (events, event types, sessions, visitors, and events per session) and the top event and page.

權限範圍analytics:read可批次
附加權限範圍
[
  {
    "when": "filter.type=saved",
    "scopes": [
      "analytics:read",
      "analysis:read"
    ]
  }
]
路徑參數
siteIdstring必填

ID of the site (see List sites).

≥ 1 chars
請求主體application/json
timeRangeobject必填

Reporting window. Use { "kind": "preset", "preset": "last_7_days" } or an absolute range { "kind": "absolute", "from": "…", "to": "…" } with RFC 3339 timestamps. timeZone (IANA name) sets calendar boundaries for presets and buckets.

filterobject | 任意 | null

Optional filter: { "type": "dsl", "expression": "page.path startsWith \"/blog\"" } uses the filter language, { "type": "inline", "expression": … } passes a structured expression, and { "type": "saved", "id": "…" } references a saved filter (requires analysis:read). Team queries accept dsl and inline only. Use null or omit the field for no filter.

scopestring

Which entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.

可用值"auto""event""session""visitor"
回應
POST/api/v1/sites/{siteId}/analytics/events/timeseries

取得事件時間序列

Returns event counts at time points. series contains top-N event-type aggregates for the whole window; points contains the time buckets. The request limit controls top-N event types, not the number of points.

權限範圍analytics:read可批次
附加權限範圍
[
  {
    "when": "filter.type=saved",
    "scopes": [
      "analytics:read",
      "analysis:read"
    ]
  }
]
路徑參數
siteIdstring必填

ID of the site (see List sites).

≥ 1 chars
請求主體application/json
timeRangeobject必填

Reporting window. Use { "kind": "preset", "preset": "last_7_days" } or an absolute range { "kind": "absolute", "from": "…", "to": "…" } with RFC 3339 timestamps. timeZone (IANA name) sets calendar boundaries for presets and buckets.

filterobject | 任意 | null

Optional filter: { "type": "dsl", "expression": "page.path startsWith \"/blog\"" } uses the filter language, { "type": "inline", "expression": … } passes a structured expression, and { "type": "saved", "id": "…" } references a saved filter (requires analysis:read). Team queries accept dsl and inline only. Use null or omit the field for no filter.

scopestring

Which entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.

可用值"auto""event""session""visitor"
intervalstring必填

Bucket size of the time series: minute, hour, day, week, or month. Keep the number of buckets reasonable for the time range.

可用值"minute""hour""day""week""month"
limitinteger必填

Number of top event types in series, 1–12.

預設 81–12
回應
POST/api/v1/sites/{siteId}/analytics/events/search

Searches event records. Use page.limit for page size; it supports values from 1 through 200 and is independent of the events timeseries top-N limit.

權限範圍analytics:read可批次
附加權限範圍
[
  {
    "when": "filter.type=saved",
    "scopes": [
      "analytics:read",
      "analysis:read"
    ]
  }
]
路徑參數
siteIdstring必填

ID of the site (see List sites).

≥ 1 chars
請求主體application/json
timeRangeobject必填

Reporting window. Use { "kind": "preset", "preset": "last_7_days" } or an absolute range { "kind": "absolute", "from": "…", "to": "…" } with RFC 3339 timestamps. timeZone (IANA name) sets calendar boundaries for presets and buckets.

filterobject | 任意 | null

Optional filter: { "type": "dsl", "expression": "page.path startsWith \"/blog\"" } uses the filter language, { "type": "inline", "expression": … } passes a structured expression, and { "type": "saved", "id": "…" } references a saved filter (requires analysis:read). Team queries accept dsl and inline only. Use null or omit the field for no filter.

scopestring

Which entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.

可用值"auto""event""session""visitor"
searchstring

Case-insensitive text search.

1–160 chars
eventNamestring

Only events with this name.

1–120 chars
sortobject必填

Sort field and direction.

預設 {"field":"occurredAt","direction":"desc"}
fieldstring必填
可用值"occurredAt""eventName""pathname"
directionstring必填
可用值"asc""desc"
pageobject必填

Cursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.

預設 {"limit":80}
limitinteger必填
預設 801–200
cursorstring | 任意 | null
回應
POST/api/v1/sites/{siteId}/analytics/events/detail

取得事件

Returns one event with its payload, page, session, and visitor context.

權限範圍analytics:read可批次
路徑參數
siteIdstring必填

ID of the site (see List sites).

≥ 1 chars
請求主體application/json
timeRangeobject必填

Reporting window. Use { "kind": "preset", "preset": "last_7_days" } or an absolute range { "kind": "absolute", "from": "…", "to": "…" } with RFC 3339 timestamps. timeZone (IANA name) sets calendar boundaries for presets and buckets.

eventIdstring必填

Event ID from an events or journey response.

1–512 chars
回應
POST/api/v1/sites/{siteId}/analytics/event-types

列出事件類型

Lists the custom event names seen in the range with their counts.

權限範圍analytics:read可批次
附加權限範圍
[
  {
    "when": "filter.type=saved",
    "scopes": [
      "analytics:read",
      "analysis:read"
    ]
  }
]
路徑參數
siteIdstring必填

ID of the site (see List sites).

≥ 1 chars
請求主體application/json
timeRangeobject必填

Reporting window. Use { "kind": "preset", "preset": "last_7_days" } or an absolute range { "kind": "absolute", "from": "…", "to": "…" } with RFC 3339 timestamps. timeZone (IANA name) sets calendar boundaries for presets and buckets.

filterobject | 任意 | null

Optional filter: { "type": "dsl", "expression": "page.path startsWith \"/blog\"" } uses the filter language, { "type": "inline", "expression": … } passes a structured expression, and { "type": "saved", "id": "…" } references a saved filter (requires analysis:read). Team queries accept dsl and inline only. Use null or omit the field for no filter.

scopestring

Which entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.

可用值"auto""event""session""visitor"
searchstring

Case-insensitive text search.

1–160 chars
pageobject必填

Cursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.

預設 {"limit":20}
limitinteger必填
預設 201–200
cursorstring | 任意 | null
回應
POST/api/v1/sites/{siteId}/analytics/event-types/detail

取得事件類型

Returns totals, a trend, and breakdowns by page, country, device, and browser for one event name.

權限範圍analytics:read可批次
附加權限範圍
[
  {
    "when": "filter.type=saved",
    "scopes": [
      "analytics:read",
      "analysis:read"
    ]
  }
]
路徑參數
siteIdstring必填

ID of the site (see List sites).

≥ 1 chars
請求主體application/json
timeRangeobject必填

Reporting window. Use { "kind": "preset", "preset": "last_7_days" } or an absolute range { "kind": "absolute", "from": "…", "to": "…" } with RFC 3339 timestamps. timeZone (IANA name) sets calendar boundaries for presets and buckets.

filterobject | 任意 | null

Optional filter: { "type": "dsl", "expression": "page.path startsWith \"/blog\"" } uses the filter language, { "type": "inline", "expression": … } passes a structured expression, and { "type": "saved", "id": "…" } references a saved filter (requires analysis:read). Team queries accept dsl and inline only. Use null or omit the field for no filter.

scopestring

Which entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.

可用值"auto""event""session""visitor"
eventNamestring必填

Custom event name, as sent by the tracking script.

1–120 chars
intervalstring必填

Bucket size of the trend. Defaults to day.

可用值"minute""hour""day""week""month"
預設 "day"
回應
POST/api/v1/sites/{siteId}/analytics/event-types/fields

列出事件欄位

Lists the payload fields of one event name, with their value types and how often they appear.

權限範圍analytics:read可批次
附加權限範圍
[
  {
    "when": "filter.type=saved",
    "scopes": [
      "analytics:read",
      "analysis:read"
    ]
  }
]
路徑參數
siteIdstring必填

ID of the site (see List sites).

≥ 1 chars
請求主體application/json
timeRangeobject必填

Reporting window. Use { "kind": "preset", "preset": "last_7_days" } or an absolute range { "kind": "absolute", "from": "…", "to": "…" } with RFC 3339 timestamps. timeZone (IANA name) sets calendar boundaries for presets and buckets.

filterobject | 任意 | null

Optional filter: { "type": "dsl", "expression": "page.path startsWith \"/blog\"" } uses the filter language, { "type": "inline", "expression": … } passes a structured expression, and { "type": "saved", "id": "…" } references a saved filter (requires analysis:read). Team queries accept dsl and inline only. Use null or omit the field for no filter.

scopestring

Which entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.

可用值"auto""event""session""visitor"
eventNamestring必填

Custom event name, as sent by the tracking script.

1–120 chars
pageobject必填

Cursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.

預設 {"limit":100}
limitinteger必填
預設 1001–200
cursorstring | 任意 | null
回應
POST/api/v1/sites/{siteId}/analytics/event-types/field-values

搜尋事件欄位值

Returns the values of one payload field of an event name, with counts.

權限範圍analytics:read可批次
附加權限範圍
[
  {
    "when": "filter.type=saved",
    "scopes": [
      "analytics:read",
      "analysis:read"
    ]
  }
]
路徑參數
siteIdstring必填

ID of the site (see List sites).

≥ 1 chars
請求主體application/json
timeRangeobject必填

Reporting window. Use { "kind": "preset", "preset": "last_7_days" } or an absolute range { "kind": "absolute", "from": "…", "to": "…" } with RFC 3339 timestamps. timeZone (IANA name) sets calendar boundaries for presets and buckets.

filterobject | 任意 | null

Optional filter: { "type": "dsl", "expression": "page.path startsWith \"/blog\"" } uses the filter language, { "type": "inline", "expression": … } passes a structured expression, and { "type": "saved", "id": "…" } references a saved filter (requires analysis:read). Team queries accept dsl and inline only. Use null or omit the field for no filter.

scopestring

Which entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.

可用值"auto""event""session""visitor"
eventNamestring必填

Custom event name, as sent by the tracking script.

1–120 chars
fieldPathstring必填

JSON Pointer to the field, e.g. /plan.

1–240 chars
fieldValueTypestring必填

Value type to list, as returned by List event fields.

可用值"string""number""boolean""null""object""array"
searchstring

Case-insensitive text search.

≤ 256 chars
pageobject必填

Cursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.

預設 {"limit":25}
limitinteger必填
預設 251–100
cursorstring | 任意 | null
回應