Get Website Analytics
get_website_analytics(domain: string, startDate: string, endDate: string, dimension?: enum)Sessions/users/engagement from owned website analytics.
First-party Google Analytics 4 (GA4) traffic metrics: sessions, active users, and average engagement rate.
Input Parameters
4 arguments| Parameter | Type | Requirement | Default / Constraints | Description |
|---|---|---|---|---|
domain | string | required | A tracked website's primary_domain (e.g. example.com). | |
startDate | string | required | Start date for GA4 report. | |
endDate | string | required | End date for GA4 report. | |
dimension | enum | optional | Break traffic metrics down by calendar date, landing page path, or session acquisition source. |
Return Envelope (OFE / 1.0)
Open Fact EnvelopeEvery response adheres to the strict ofe/1.0 envelope schema, returning verified data, typed facts, entity references, and follow-up tool suggestions:
data Payload
First-party Google Analytics 4 (GA4) traffic metrics: sessions, active users, and average engagement rate.
coverage & Freshness
Reports returned count vs total items, observation timestamp as_of, and scope notes. Evaluated live per request.
resources (Dataset Exports)
If a query yields high row counts (e.g. >1,000 queries in Search Console), full unpaginated tables are persisted to R2 and linked as an mcpseo:// URI for follow-up retrieval via export_dataset.
next_actions
Provides suggested follow-up tool calls with pre-filled arguments so your AI agent can navigate from discovery to detailed inspection autonomously.
Emitted Facts & Entities
Knowledge GraphTyped Facts
Facts emitted in the facts[] array with provenance receipts:
| Fact Type | Claim Description | Emitted Data Fields |
|---|---|---|
analytics.traffic_summary | Aggregated period totals for sessions, active users, and engagement rate. | sessionsactive_usersavg_engagement_ratestart_dateend_date |
analytics.traffic_by_dimension | Row breakdown for selected dimension (date, page, or referral source). | dimensiondimension_valuesessionsactive_usersengagement_rate |
Registered Entities
Entities registered in the entities[] array to establish subject relationships:
Connected GA4 property entity.
Landing page entities when dimension is 'pagePath'.
Request & Response Examples
Live MCP PayloadsExact JSON schemas transmitted over Model Context Protocol (stdio or HTTP SSE transport):
1. Client Tool Invocation
{
"tool": "get_website_analytics",
"arguments": {
"domain": "example.com",
"startDate": "2026-09-01",
"endDate": "2026-09-20",
"dimension": "pagePath"
}
}2. Server Envelope Response
{
"schema_version": "ofe/1.0",
"domain": "analytics",
"data": {
"domain": "example.com",
"startDate": "2026-09-01",
"endDate": "2026-09-20",
"dimension": "pagePath",
"totals": {
"sessions": 48500,
"activeUsers": 34200,
"avgEngagementRate": 0.642
}
},
"facts": [
{
"type": "analytics.traffic_summary",
"subject": [
"urn:property:ws_12345"
],
"data": {
"sessions": 48500,
"active_users": 34200,
"avg_engagement_rate": 0.642,
"start_date": "2026-09-01",
"end_date": "2026-09-20"
},
"provenance": {
"source_class": "analytics_property",
"method": "analyticsdata.properties.runReport",
"confidence": 1,
"observed_at": "2026-09-24T00:00:00Z",
"cache_hit": false
}
},
{
"type": "analytics.traffic_by_dimension",
"subject": [
"urn:property:ws_12345",
"urn:page:%2Fpricing"
],
"data": {
"dimension": "pagePath",
"dimension_value": "/pricing",
"sessions": 12400,
"active_users": 9800,
"engagement_rate": 0.781
},
"provenance": {
"source_class": "analytics_property",
"method": "analyticsdata.properties.runReport",
"confidence": 1,
"observed_at": "2026-09-24T00:00:00Z",
"cache_hit": false
}
}
],
"entities": [
{
"id": "urn:property:ws_12345",
"kind": "property",
"label": "Example Prod"
},
{
"id": "urn:page:%2Fpricing",
"kind": "page",
"label": "/pricing"
}
],
"coverage": {
"returned": 2,
"total": 2,
"as_of": "2026-09-20",
"scope_note": null
},
"deltas": [],
"resources": [],
"next_actions": []
}LLM Agent Workflow
Claude & Cursor IntegrationPrompt Trigger
"How engaged are visitors on /pricing compared to the rest of the site in GA4?"
Agent Decision & Reasoning
The agent pulls first-party GA4 engagement metrics to correlate search impression traffic with actual conversion and on-page dwell times.
Recommended Follow-up Tools
Provenance Guarantees & Error Handling
ReliabilityEvery fact emitted by Vouched includes source_class, method, observed_at ISO timestamp, and a published confidence score. LLM agents can inspect these citations to distinguish first-party verified facts (e.g. Search Console) from modeled competitor estimates.
Billing & API Keys
Free on every plan: it reads your own Google data, so there's no per-call cost. Works the same when self-hosted.
Connection Required: Requires connecting your Google Analytics (GA4) property via OAuth. Until it's connected, calls return a connection_required error saying where to connect it (Settings in the dashboard).
Error Conditions
ConnectionRequiredError: no GA4 property configured for domain. Add connection via /dashboard/connections.