嵌入式组件
组件分析
小组件的会话、线索、消息、转化率及地理分布的聚合统计数据。
GET
/
api
/
v1
/
iframes
/
{id}
/
analytics
组件分析
curl --request GET \
--url https://api.example.com/api/v1/iframes/{id}/analyticsimport requests
url = "https://api.example.com/api/v1/iframes/{id}/analytics"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/iframes/{id}/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/iframes/{id}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/iframes/{id}/analytics"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/iframes/{id}/analytics")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/iframes/{id}/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"window": "<string>",
"kpi": {},
"previous_period_kpi": {},
"series": {},
"top_referrers": [
{}
],
"top_countries": [
{}
],
"top_country_coords": [
{}
]
}返回所选时间窗口的关键指标(KPI)、用于对比的上一周期数据、按日的时间序列,以及排名靠前的推荐来源/国家/地区。
身份验证
需要提供 Bearer 令牌(API 密钥)或仪表盘会话。路径参数
string
必填
小组件配置的 UUID。
查询参数
string
默认值:"30d"
报告时间窗口:
7d、30d 或 90d。响应
string
实际生效的时间窗口。
object
total_sessions、total_leads、total_messages、conversion_rate、avg_session_duration_seconds、avg_messages_per_session、identified_sessions、anonymous_sessions。object
上一周期的相同 KPI 数据结构。
object
按日的时间序列:
sessions、leads、messages,每项均为 { day, count } 组成的数组。array
最多 10 条
{ url, count } 记录。array
最多 10 条
{ country, count } 记录。array
可直接用于地图渲染的
{ country, name, lat, lng, count } 记录,对应排名靠前的国家/地区。示例
curl
curl "https://www.hitheo.ai/api/v1/iframes/CONFIG_ID/analytics?window=7d" \
-H "Authorization: Bearer $THEO_API_KEY"
此页面对您有帮助吗?
组件分析
curl --request GET \
--url https://api.example.com/api/v1/iframes/{id}/analyticsimport requests
url = "https://api.example.com/api/v1/iframes/{id}/analytics"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/iframes/{id}/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/iframes/{id}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/iframes/{id}/analytics"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/iframes/{id}/analytics")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/iframes/{id}/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"window": "<string>",
"kpi": {},
"previous_period_kpi": {},
"series": {},
"top_referrers": [
{}
],
"top_countries": [
{}
],
"top_country_coords": [
{}
]
}