Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions contents/docs/web-analytics/query-traffic-mcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ With MCP, your coding agent can:
- **Investigate anomalies** – "Why did pageviews drop this morning?" to quickly diagnose issues
- **Analyze referral sources** – "Which sources are driving the most traffic to the blog?" to inform content decisions
- **Monitor page performance** – "What's the bounce rate on our landing pages this week?" to catch regressions
- **Summarize site traffic** – "How did the site perform last month?" to get a quick overview of visitors, top pages, and sources

## Web Analytics tools

The MCP server uses these tools for querying web analytics data:

| Tool | Description |
|------|-------------|
| `query-run` | Run a HogQL query against your web analytics data. Supports pageview counts, bounce rates, session durations, traffic breakdowns, and path analysis. |
| `query-generate-hogql-from-question` | Generate a HogQL query from a natural language question about traffic. Returns the query for review before running. |
| `insight-create-from-query` | Create a saved insight from a traffic query and add it to a dashboard. |
| Tool | Description |
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `query-run` | Run a HogQL query against your web analytics data. Supports pageview counts, bounce rates, session durations, traffic breakdowns, and path analysis. |
| `query-generate-hogql-from-question` | Generate a HogQL query from a natural language question about traffic. Returns the query for review before running. |
| `insight-create-from-query` | Create a saved insight from a traffic query and add it to a dashboard. |
| `web-analytics-weekly-digest` | Summarize web analytics over a configurable lookback window (1–90 days, default 7). Returns visitors, pageviews, sessions, bounce rate, average session duration, top pages, top sources, and goal conversions with period-over-period comparisons. |

## Example prompts

Expand All @@ -35,6 +37,9 @@ Try these with your MCP-enabled agent:
- `What's the bounce rate on /pricing compared to /docs?`
- `Which countries are driving the most traffic?`
- `Create a dashboard showing daily pageviews, top pages, and traffic by source.`
- `How are my web analytics doing?`
- `Summarize last week's traffic.`
- `How did the site perform over the last 30 days?`

## Install the MCP server

Expand Down
Loading