嵌入式組件
組件分析
小組件的會話、線索、消息、轉化率及地理分佈的聚合統計數據。
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": [
{}
]
}