Analytics
Analytics is the audience view for a project: who is visiting, where they come from, and what they browse with. Like Metrics, analytics is captured server-side by the PandaStack gateway from request headers — there is no tracking script to add to your site.
How analytics is captured
Section titled “How analytics is captured”- The gateway logs each request into the same ClickHouse event log (
pandastack.request_events) used by Metrics, forwarding the request headers (user-agent, referer, country) so audience dimensions can be derived. - Analytics is per-project and tenant-safe: the project is resolved and ownership-checked in Postgres before any ClickHouse query, which is then filtered by project name.
- Bots are excluded from audience counts (
is_bot = 0), except for the dedicatedbotViewsfigure. - Analytics fails open: if ClickHouse is unconfigured, endpoints return an empty shape with
enabled: false.
Two gates
Section titled “Two gates”Analytics is gated twice, so an empty response can mean two different things:
- Plan gate — analytics is a paid feature. Free organizations receive a
402(quota_exceeded) upgrade prompt. - Per-project toggle — each project has an
enable_analyticsflag. When it is off, the API returns empty data withanalyticsEnabled: false(not an error) so the dashboard can show an “enable analytics” prompt rather than a failure.
So enabled reflects whether ClickHouse is configured platform-wide, while analyticsEnabled
reflects whether this specific project has analytics turned on.
Time ranges
Section titled “Time ranges”Analytics reuses the same ranges and bucket widths as Metrics:
range | Window | Bucket width |
|---|---|---|
1h | 1 hour | Per-minute |
24h | 24 hours | 10-minute |
7d | 7 days | Hourly |
30d | 30 days | 6-hour |
The summary
Section titled “The summary”| Field | Meaning |
|---|---|
uniqueVisitors | Distinct visitors in the range. |
totalViews | Non-bot request count. |
botViews | Requests identified as bots. |
returningVisitors | Visitors with more than one view. |
viewsPerVisitor | Average views per visitor. |
enabled | ClickHouse configured platform-wide. |
analyticsEnabled | This project has analytics turned on. |
Time series
Section titled “Time series”The analytics time series returns one point per bucket, each with visitors and views (nullable).
Counts zero-fill empty buckets so charts draw to the baseline.
Breakdowns
Section titled “Breakdowns”Each breakdown is a list of { label, visitors, views } rows:
| Breakdown | Derived from |
|---|---|
| Top countries | Visitor geography (shown with country flags in the dashboard). |
| Top referrers | The referer header. |
| Top pages | Requested paths. |
| Browsers | Parsed user-agent browser (ua_browser). |
| Devices | Parsed user-agent device (ua_device). |
Analytics vs. Metrics
Section titled “Analytics vs. Metrics”| Analytics | Metrics | |
|---|---|---|
| Question answered | Who is visiting? | How is the service performing? |
| Typical fields | Visitors, countries, referrers, browsers, devices | Requests, error rate, latency, bandwidth, RPS |
| Bots | Excluded (except botViews) | Counted as requests |
| Gating | Paid plan and per-project toggle | Available to all plans (no separate toggle) |
| Source | ClickHouse request_events (server-side, no SDK) | ClickHouse request_events (server-side, no SDK) |
Related
Section titled “Related”- Metrics — the performance-and-health sibling of Analytics.
- Uptime monitors — active URL checks and alerts.
- Metrics & analytics API reference — endpoints and schemas.