Site Data Integration
When to use
Use this skill whenever a task requires reading web analytics for a site (visitors, pageviews, traffic sources, heatmaps, realtime activity, goals, funnels, or uptime), or when a site record itself needs to be created, updated, listed, or removed in Site Data. Typical triggers: a report asking for traffic trends, a request to check whether a site is currently up, a request to register a new site for tracking, or a downstream agent needing a site's api_key/domain_key before it can push events.
Tools
http-get— read-only calls (list/fetch sites, overview, breakdown, heatmap, confetti, realtime, goals, funnels, uptime)http-post— create a new sitehttp-request— update (PATCH) or delete (DELETE) an existing sitewrite-file— stage large result sets (breakdowns, confetti data, incident lists) instead of inlining themsend-message— escalate to a human on auth failure, missing Integration, or ambiguous site identity
Playbook
- Resolve which site you are working with. Call
http-geton/api/v1/sitesto list all sites owned by the authenticated user and match by name or domain. If the site does not exist yet and the task calls for tracking a new domain, callhttp-poston/api/v1/sitesto create it (or return the existing one matching that domain) — capture the returnedid,api_key, anddomain_key. - To confirm or refresh details for a known site, call
http-geton/api/v1/sites/:id. - For a traffic summary (visitors, pageviews, sessions) over a period, call
http-geton/api/v1/sites/:id/overview, passing the requested period as query parameters. - For a breakdown by dimension (source, page, device, etc.), call
http-geton/api/v1/sites/:id/breakdownwith the dimension and period as query parameters. - For click/scroll heatmap data, first call
http-geton/api/v1/sites/:id/heatmap/pagesto see which pages have data, then callhttp-geton/api/v1/sites/:id/heatmapfor the chosen page. For individual click events, usehttp-geton/api/v1/sites/:id/confetti. - For live visitor activity, call
http-geton/api/v1/sites/:site_id/stats/realtime. - For conversion tracking, call
http-geton/api/v1/sites/:site_id/stats/goalsfor goals or/api/v1/sites/:site_id/stats/funnelsfor funnel stats. - For availability monitoring, call
http-geton/api/v1/sites/:site_id/stats/uptimefor the current status summary, and/api/v1/sites/:site_id/stats/uptime/incidentsfor the incident history. - To rename a site, change its domain, or update its timezone, use
http-requestwith PATCH against/api/v1/sites/:id. - To decommission a site, use
http-requestwith DELETE against/api/v1/sites/:id. Confirm this is intended before deleting — it is destructive. - When any response set is large (long breakdown tables, confetti event dumps, multi-day incident logs), use
write-fileto stage the raw payload before summarizing it, rather than pasting it inline.
Failure modes
- 401 or 403 on any call: stop immediately, do not retry, and use
send-messageto notify a human, naming "Site Data" as the app and stating that the integration's credentials need thesitesread/write scope re-checked. - No Integration row configured for Site Data in the org: use
send-messageto ask a human to add one before proceeding — do not fabricate a base URL or API key. - Ambiguous or missing site identity (name/domain doesn't match any listed site): re-list sites with
http-geton/api/v1/sitesand, if still unresolved, usesend-messageto ask a human to confirm which site is intended rather than guessing anid. - Empty or zeroed analytics response: treat as a valid "no traffic in period" result, not an error — do not retry the same call repeatedly.
Done when
The requested site data has been fetched, summarized, or staged via write-file, or the requested site record has been created, updated, or deleted and its confirmation (id, api_key/domain_key, or deletion acknowledgment) has been reported back.