文件
APIAPI 參考

網站設定

追蹤、隱私與分享設定,以及網站的統計指令碼。

GET/api/v1/sites/{siteId}/settings/tracking

取得追蹤設定

Returns what the tracking script records for the site: query strings, hashes, Web Vitals, outbound links, tracking strength, allowed domains, and excluded paths.

權限範圍site_config:read
路徑參數
siteIdstring必填

ID of the site (see List sites).

1–256 chars
回應
PATCH/api/v1/sites/{siteId}/settings/tracking

更新追蹤設定

Updates the tracking settings. Send only the fields to change. The tracking script picks up the change on its next load.

權限範圍site_config:write
路徑參數
siteIdstring必填

ID of the site (see List sites).

1–256 chars
請求主體application/json
trackQueryboolean
trackHashboolean
trackWebVitalsboolean
autoTrackOutboundLinksboolean
trackingStrengthstring

How visitors are identified: strong, smart (default), or weak. See the tracking settings guide.

可用值"strong""smart""weak"
allowedDomainsstring[]

Hostnames allowed to send data. Empty allows the site's own domain.

excludedPathsstring[]

Path patterns that are never recorded.

回應
GET/api/v1/sites/{siteId}/settings/privacy

取得隱私設定

Returns the site's privacy settings, including Do Not Track handling and EU mode. IP anonymization, daily visitor tokens, and the retention period are fixed and returned for reference.

權限範圍site_config:read
路徑參數
siteIdstring必填

ID of the site (see List sites).

1–256 chars
回應
PATCH/api/v1/sites/{siteId}/settings/privacy

更新隱私設定

Updates whether Do Not Track is respected and whether EU mode is on. Send only the fields to change.

權限範圍site_config:write
路徑參數
siteIdstring必填

ID of the site (see List sites).

1–256 chars
請求主體application/json
respectDoNotTrackboolean
euModeboolean
回應
GET/api/v1/sites/{siteId}/settings/sharing

取得分享設定

Returns whether the site's public dashboard is enabled and its slug.

權限範圍site_config:read
路徑參數
siteIdstring必填

ID of the site (see List sites).

1–256 chars
回應
PATCH/api/v1/sites/{siteId}/settings/sharing

更新分享設定

Enables or disables the public dashboard, or changes its slug. Send only the fields to change.

權限範圍site_config:write
路徑參數
siteIdstring必填

ID of the site (see List sites).

1–256 chars
請求主體application/json
publicEnabledboolean
publicSlugstring | null
回應
GET/api/v1/sites/{siteId}/settings/tracking-script

取得追蹤指令碼

Returns the tracking script URL and an HTML snippet to paste into the site's pages.

權限範圍site_config:read
路徑參數
siteIdstring必填

ID of the site (see List sites).

1–256 chars
回應