Bring Web Analytics
to OpenAI Agents SDK
Learn how to connect Google Analytics 4 to OpenAI Agents SDK and start using 12 AI agent tools in minutes. Fully managed, enterprise secure, and ready to use without writing a single line of code.
What is the Google Analytics 4 MCP Server?
Connect your Google Analytics 4 property to any AI agent and access web analytics through natural conversation.
What you can do
- Custom Reports — Run fully customizable GA4 reports with any combination of dimensions, metrics, and date ranges
- Real-Time Analytics — Monitor active users and current page views in real time
- Page Performance — Retrieve the top 25 pages ranked by views for any time period
- Traffic Sources — Analyze session sources and mediums to understand where visitors come from
- User Demographics — View user distribution by country for geographic insights
- Device Breakdown — See user distribution across desktop, mobile, and tablet
- Conversions — Track conversion events with counts and revenue data
- Advanced Reporting — Run pivot reports and batch multiple reports in a single request
- Metadata & Compatibility — List all available dimensions and metrics, and verify compatibility before building reports
How it works
1. Subscribe to this server
2. Enter your Google OAuth Access Token and GA4 Property ID
3. Start querying your analytics from Claude, Cursor, or any MCP-compatible client
Who is this for?
- Marketing Teams — track campaign performance, traffic sources, and conversion funnels without opening the GA4 dashboard
- Product Managers — monitor feature adoption through page views and user engagement metrics
- Growth Engineers — analyze device breakdown, demographics, and real-time traffic patterns to optimize user experience
Built-in capabilities (12)
Batch run reports
Check report compatibility
Get conversions
Get device breakdown
Get available dimensions and metrics
Get top pages by views
Get traffic sources
Get user demographics
List audience exports
Run pivot report
Run realtime report
Data JSON must include dateRanges, dimensions, and metrics arrays. Run a custom report
Why OpenAI Agents SDK?
The OpenAI Agents SDK auto-discovers all 12 tools from Google Analytics 4 through native MCP integration. Build agents with built-in guardrails, tracing, and handoff patterns. chain multiple agents where one queries Google Analytics 4, another analyzes results, and a third generates reports, all orchestrated through Vinkius.
- —
Native MCP integration via
MCPServerSse, pass the URL and the SDK auto-discovers all tools with full type safety - —
Built-in guardrails, tracing, and handoff patterns let you build production-grade agents without reinventing safety infrastructure
- —
Lightweight and composable: chain multiple agents and MCP servers in a single pipeline with minimal boilerplate
- —
First-party OpenAI support ensures optimal compatibility with GPT models for tool calling and structured output
Google Analytics 4 in OpenAI Agents SDK
Google Analytics 4 and 3,400+ other MCP servers. One platform. One governance layer.
Teams that connect Google Analytics 4 to OpenAI Agents SDK through Vinkius don't need to source, host, or maintain individual MCP servers. Every tool call runs inside a hardened runtime with credential isolation, DLP, and a signed audit chain.
Raw MCP | Vinkius | |
|---|---|---|
| Server catalog | Find and host yourself | 3,400+ managed |
| Infrastructure | Self-hosted | Sandboxed V8 isolates |
| Credential handling | Plaintext in config | Vault + runtime injection |
| Data loss prevention | None | Configurable DLP policies |
| Kill switch | None | Global instant shutdown |
| Financial circuit breakers | None | Per-server limits + alerts |
| Audit trail | None | Ed25519 signed logs |
| SIEM log streaming | None | Splunk, Datadog, Webhook |
| Honeytokens | None | Canary alerts on leak |
| Custom domains | Not applicable | DNS challenge verified |
| GDPR compliance | Manual effort | Automated purge + export |
Why teams choose Vinkius for Google Analytics 4 in OpenAI Agents SDK
The Google Analytics 4 MCP Server runs on Vinkius-managed infrastructure inside AWS — a purpose-built runtime with per-request V8 isolates, Ed25519 signed audit chains, and sub-40ms cold starts. All 12 tools execute in hardened sandboxes optimized for native MCP execution.
Your AI agents in OpenAI Agents SDK only access the data you authorize, with DLP that blocks sensitive information from ever reaching the model, kill switch for instant shutdown, and up to 60% token savings. Enterprise-grade infrastructure, zero maintenance.

* Every MCP server runs on Vinkius-managed infrastructure inside AWS - a purpose-built runtime with per-request V8 isolates, Ed25519 signed audit chains, and sub-40ms cold starts optimized for native MCP execution. See our infrastructure
How Vinkius secures
Google Analytics 4 for OpenAI Agents SDK
Every tool call from OpenAI Agents SDK to the Google Analytics 4 MCP Server is protected by DLP redaction, cryptographic audit chains, V8 sandbox isolation, kill switch, and financial circuit breakers.
Frequently asked questions
Can I run custom reports with specific dimensions and metrics?
Yes! The run_report tool accepts a JSON configuration with dateRanges, dimensions (e.g., pagePath, sessionSource), and metrics (e.g., sessions, screenPageViews, conversions). Use get_metadata to list all available dimensions and metrics, and check_compatibility to verify your combination is valid before running.
Does GA4 require two credentials — an access token and a property ID?
Yes. You need a Google OAuth Access Token (for authentication via Bearer header) and a GA4 Property ID (numeric ID identifying your specific GA4 property). The Access Token can be generated via a Google Cloud Service Account with the Analytics Data API enabled. The Property ID is found in GA4 Admin > Property Settings.
Can I see real-time active users on my website?
Yes. The run_realtime_report tool provides current active user data with real-time dimensions and metrics. For pre-built convenience reports, use get_page_views for top pages, get_traffic_sources for session sources, and get_device_breakdown for device distribution.
How does the OpenAI Agents SDK connect to MCP?
Use MCPServerSse(url=...) to create a server connection. The SDK auto-discovers all tools and makes them available to your agent with full type information.
Can I use multiple MCP servers in one agent?
Yes. Pass a list of MCPServerSse instances to the agent constructor. The agent can use tools from all connected servers within a single run.
Does the SDK support streaming responses?
Yes. The SDK supports SSE and Streamable HTTP transports, both of which work natively with Vinkius.
MCPServerStreamableHttp not found
Ensure you have the latest version: pip install --upgrade openai-agents
Agent not calling tools
Make sure your prompt explicitly references the task the tools can help with.
