Embed Widgets
Widget Analytics
Aggregated sessions, leads, messages, conversion, and geo breakdown for a widget.
GET
/
api
/
v1
/
iframes
/
{id}
/
analytics
Widget 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": [
{}
]
}Returns KPIs for the selected window, the previous period for comparison, daily time series, and top referrers/countries.
Authentication
Requires a Bearer token (API key) or a dashboard session.Path Parameters
string
required
The widget config UUID.
Query Parameters
string
default:"30d"
Reporting window:
7d, 30d, or 90d.Response
string
The window that was applied.
object
total_sessions, total_leads, total_messages, conversion_rate, avg_session_duration_seconds, avg_messages_per_session, identified_sessions, anonymous_sessions.object
The same KPI shape for the immediately preceding period.
object
Daily time series:
sessions, leads, messages, each an array of { day, count }.array
Up to 10
{ url, count } entries.array
Up to 10
{ country, count } entries.array
Map-ready
{ country, name, lat, lng, count } entries for the top countries.Example
curl
curl "https://www.hitheo.ai/api/v1/iframes/CONFIG_ID/analytics?window=7d" \
-H "Authorization: Bearer $THEO_API_KEY"
Was this page helpful?
Widget 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": [
{}
]
}