Syntext DOCS
Get Started
API Analytics Overview

Analytics API

The analytics API has two halves:

  1. Beacon endpoints — public, high-volume endpoints doc sites call to record page views, searches, and chat interactions. Deployed doc sites include the tracking beacon automatically; you only call these yourself for custom integrations.
  2. Dashboard endpoints — authenticated endpoints that return aggregated metrics.

Beacon Endpoints (public, no auth)

All beacons return 202 Accepted immediately and process asynchronously.

Track Page View

Page path, e.g. /guides/quickstart. Anonymous visitor ID. Session ID for flow analysis. Document referrer. Time on page in seconds. desktop, mobile, or tablet. Previous page path (navigation flow). Whether the visit was a bounce.

The search query. Number of results returned. Zero-result queries surface in the gaps report. Path of the result the visitor clicked.

Track Chat Interaction

The question asked. Answer confidence, 0–1. thumbs_up or thumbs_down. Number of cited sources.

Dashboard Endpoints (auth required)

All accept an optional ?days=30 query parameter (default 30).

Endpoint Returns
GET /analytics/summary Totals: views, visitors, searches, AI questions — see Get Summary
GET /analytics/top-pages Most viewed pages (?limit=20)
GET /analytics/views-over-time Daily page view series
GET /analytics/searches Popular searches + zero-result queries
GET /analytics/gaps Documentation gaps detected from AI chat
GET /analytics/health Per-page content health scores
GET /analytics/content-health Aggregate health — see Content Health
GET /analytics/annotation-coverage @stx coverage — see Annotation Coverage

All are relative to /v1/projects/{projectId}.

Example

curl "https://api.syntext.dev/v1/projects/prj_abc123/analytics/top-pages?days=7&limit=10" \
  -H "Authorization: Bearer stx_abc12345_..."

The dashboard at syntext.dev visualizes all of this — the API exists for custom reporting and exports. See Analytics & Insights for the feature guide.

Assistant
Responses are generated using AI and may contain mistakes.

Ask me anything about the documentation.

ESC