ドキュメント
APIAPI リファレンス

ゴール

ゴールの作成・取得・更新・削除と、ゴールの集計・時系列。

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

Returns a goal's conversions and conversion rate by sessions and by visitors.

スコープ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"
goalIdstring必須

ID of a goal (see List goals).

1–512 chars
レスポンス
POST/api/v1/sites/{siteId}/analytics/goals/timeseries

Returns a goal's conversions for each time bucket.

スコープ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"
goalIdstring必須

ID of a goal (see List goals).

1–512 chars
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"
レスポンス
GET/api/v1/sites/{siteId}/goals

ゴールを一覧表示

Lists the site's goals.

スコープanalysis:read
パスパラメーター
siteIdstring必須

ID of the site (see List sites).

1–256 chars
クエリパラメーター
limitinteger

Maximum number of results per page.

既定値 501–200
cursorstring | 任意 | null

Opaque pagination cursor from the previous response.

レスポンス
POST/api/v1/sites/{siteId}/goals

ゴールを作成

Creates a goal. A goal converts when an event, page view, session, or visitor matches its filter.

スコープanalysis:write
パスパラメーター
siteIdstring必須

ID of the site (see List sites).

1–256 chars
リクエストボディapplication/json
filterDslVersion1必須

Filter language version. Always 1.

既定値 1
filterDslstring必須

Filter expression that defines a conversion.

1–65536 chars
namestring必須

Display name.

1–200 chars
レスポンス
GET/api/v1/sites/{siteId}/goals/{goalId}

ゴールを取得

Returns one goal.

スコープanalysis:read
パスパラメーター
siteIdstring必須

ID of the site (see List sites).

1–256 chars
goalIdstring必須

ID of the goal.

1–256 chars
レスポンス
PATCH/api/v1/sites/{siteId}/goals/{goalId}

ゴールを更新

Updates a goal. Send only the fields to change.

スコープanalysis:write
パスパラメーター
siteIdstring必須

ID of the site (see List sites).

1–256 chars
goalIdstring必須

ID of the goal.

1–256 chars
リクエストボディapplication/json
filterDslVersion1
既定値 1
filterDslstring
1–65536 chars
namestring
1–200 chars
レスポンス
DELETE/api/v1/sites/{siteId}/goals/{goalId}

ゴールを削除

Deletes a goal. Collected data is not affected.

スコープanalysis:write
パスパラメーター
siteIdstring必須

ID of the site (see List sites).

1–256 chars
goalIdstring必須

ID of the goal.

1–256 chars
レスポンス