Analytics Overview
Track doc site usage with beacon endpoints and query aggregated analytics from the dashboard API.
The analytics API has two halves:
Beacon Endpoints (public, no auth)
All beacons return 202 Accepted immediately and process asynchronously.
Track Page View
/v1/projects/{projectId}/analytics/pageviewpagePath/guides/quickstart.visitorIdsessionIdreferrerdurationdeviceTypedesktop, mobile, or tablet.previousPageisBouncecountryuserAgentbrowserosTrack Search
/v1/projects/{projectId}/analytics/searchqueryresultCountclickedResultvisitorIdTrack Chat Interaction
/v1/projects/{projectId}/analytics/chatquestionconfidencefeedbackthumbs_up or thumbs_down.citationCountsessionIdanswerLengthpagePathvisitorIdTrack Playground Request
/v1/projects/{projectId}/analytics/playgroundendpointPathmethodstatusCoderesponseTimeMslanguagevisitorIdsessionIdTrack Funnel Event
/v1/projects/{projectId}/analytics/funnelvisitorIdeventTypelanding, signup, first_api_call, active_usage or playground_use.pagePathmetadataDashboard Endpoints (auth required)
Most accept an optional ?days= query parameter (default 30) — the table says which.
Session JWT and org membership required. Dashboard endpoints accept a
signed-in session JWT only — a project API key (stx_…) gets 401. Being
signed in is not enough: you must be a member of the org that owns
{projectId}. A project you cannot see returns 404, and one you can see but
are not a member of returns 403 with the forbidden code — see
Errors. Any role (member, admin or owner) can
read analytics, dismiss gaps and export. This does not apply to the beacon
endpoints above, which are public by design.
| Endpoint | Returns |
|---|---|
GET /analytics/summary | Totals: views, visitors, searches, AI questions, plus an exportUrl (?days=) — see Get Summary |
GET /analytics/top-pages | Most viewed pages (?days=, ?limit=20) |
GET /analytics/views-over-time | Daily page views and visitors, plus 6-hour buckets up to 14 days (?days=) — see Get Views Over Time |
GET /analytics/referrers | Top 20 referrers with isNew (?days=) — see Get Referrers |
GET /analytics/searches | Popular and zero-result searches, daily series and changes (?days=) — see Get Searches |
GET /analytics/time-on-page | Average, median and p90 seconds on page (?days=) — see Get Time on Page |
GET /analytics/ai | AI assistant analytics (?period= or ?days=) — see Get AI Insights |
GET /analytics/gaps | Open documentation gaps, paginated (?limit=, ?offset=, ?source=reported|inferred) — see List Gaps |
POST /analytics/gaps/{gapId}/dismiss | Dismiss a gap — see Dismiss Gap |
GET /analytics/export | Download a CSV or JSON report (?days=, ?format=) — see Export Insights |
GET /analytics/health | Per-page content health scores |
GET /analytics/content-health | Aggregate health with weekly history — see Content Health |
GET /analytics/annotation-coverage | @stx coverage and drift alerts — see Annotation Coverage |
GET /analytics/bounce-rate | Bounce rate (?days=) |
GET /analytics/navigation-flow | Where readers go next from a page (?pagePath= required, ?days=) |
GET /analytics/devices | Device breakdown (?days=) |
GET /analytics/geo | Country breakdown (?days=) |
GET /analytics/playground-usage | API playground usage by endpoint (?days=, ?limit=20) |
GET /analytics/broken-links | Broken links found on the site |
GET /analytics/page-metadata | Per-page readability and structure metadata |
GET /analytics/api-coverage | How much of the API reference is documented |
POST /analytics/health/compute | Recompute content health now |
GET /analytics/dx-funnel | Funnel from landing to active usage (?days=) |
GET /analytics/time-to-first-call | Time from landing to first API call (?days=) |
GET /analytics/dx-score | Developer-experience score history (?limit=30) |
POST /analytics/dx-score/compute | Recompute the developer-experience score |
All are relative to /v1/projects/{projectId}.
Trend fields are optional
Period-over-period fields — daily, changes, history, trend, exportUrl
and the like — are computed after the core figures. If one cannot be computed,
it is left out of the response rather than failing the request, so treat each
as optional. Unless a page says otherwise:
0–1000–100 ratesExample
The dashboard visualizes all of this under your project → Insights — the API exists for custom reporting and exports. See Insights for the feature guide.