文档
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
响应