分析数据
转化
读取所选项目与筛选范围的观测到的转化分析。
GET
/api/domains/{host}/agent-analytics请求#
GET /api/domains/{host}/agent-analytics?section=conversions
curl --fail-with-body 'https://app.keptai.com/api/domains/example.com/agent-analytics?section=conversions&days=30' \
-H "Authorization: Bearer $KEPT_API_TOKEN"
const response = await fetch(
'https://app.keptai.com/api/domains/example.com/agent-analytics?section=conversions&days=30',
{ headers: { Authorization: `Bearer ${process.env.KEPT_API_TOKEN}` } }
);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
console.log(data);
import json, os, urllib.request
request = urllib.request.Request(
'https://app.keptai.com/api/domains/example.com/agent-analytics?section=conversions&days=30',
headers={'Authorization': 'Bearer ' + os.environ['KEPT_API_TOKEN']}
)
with urllib.request.urlopen(request) as response:
print(json.load(response))
参数#
| 参数 | 有效值 |
|---|---|
| host(路径) | 项目域名,不含协议或路径。 |
| section | 本页使用 conversions。 |
| days | 7、30 或 90;默认 30。 |
| engine | 支持的引擎标识,可用逗号分隔多个值。 |
| topic、category、brand | 可选,使用 scope-options 返回的值,多个值以逗号分隔。 |
响应与解读#
响应为 JSON,保留应用中 conversions 分区的数据结构。集成时请保留原结构,不要假设各分区具有相同字段。请读取实际返回值,不要使用虚构的示例数据。
此视图需要域名已接入 Kept Gateway(CNAME 指向 gateway.freem.ai,并完成 DCV)。详见接入数据。