For Agents
Run GA4 reports — standard, batched, pivot, and realtime — and export audiences across 10 endpoints.
Get started with Google Analytics Data API in minutes using your preferred integration method.
# Add to your MCP client config (Claude Desktop, Cursor, Windsurf)
{
"jentic": {
"url": "https://api.jentic.com/mcp",
"auth": "oauth"
}
}
# Then ask your agent:
"run a GA4 report"
# → Jentic returns the GET /events tool with parameter schema, agent executes.What an agent can do with Google Analytics Data API API.
Run a GA4 report with dimensions, metrics, filters, and date ranges via runReport
Run several reports in parallel with batchRunReports for dashboard pages
Run pivot reports to cross dimension values for matrix-style analysis
Run a real-time report to see active users and recent events on a GA4 property
GET STARTED
Use for: Run a GA4 report for sessions by source/medium for the last 30 days, Get the top events on my GA4 property today, Run a real-time report to see active users on my site right now, List all available dimensions and metrics for a GA4 property
Not supported: Does not configure GA4 properties, send measurement events, or query Universal Analytics — use for running reports on GA4 properties only.
The Google Analytics Data API is the reporting surface for GA4 properties. It runs custom reports with dimensions and metrics, batched reports across several queries, pivot reports, real-time reports, and on-demand audience exports. It also exposes a metadata endpoint that lists every dimension and metric available on a property and a checkCompatibility call that explains why a particular dimension/metric combination is not allowed. Reporting only — property configuration goes through the Admin API.
Check whether a dimension/metric combination is compatible before running a report
Read the full list of available dimensions and metrics for a property via metadata
Trigger an audience export to create a downloadable user list for a defined audience
Patterns agents use Google Analytics Data API API for, with concrete tasks.
★ Programmatic GA4 Dashboards
Internal BI dashboards often need GA4 data alongside other warehouse data. Calling runReport from a scheduled job lets a team pull exactly the dimensions and metrics they want into a warehouse table without exporting through Looker Studio. batchRunReports reduces request overhead when a dashboard panel needs several related reports at once.
POST /v1beta/{+property}:runReport with dimensions=[date, sessionSource, sessionMedium] and metrics=[sessions, conversions], a 30-day dateRange, and write the rows to a warehouse table.
Real-Time GA4 Monitoring
Operations teams want a live view of active users when they push a release or run a campaign launch. runRealtimeReport returns active users by dimension within roughly the last 30 minutes. A small poller can wire this into a chat channel or status page so the team sees traffic shifts immediately.
POST /v1beta/{+property}:runRealtimeReport with dimensions=[country] and metrics=[activeUsers] every 60 seconds and post the breakdown to a Slack channel.
Audience Export to a CDP
Marketing teams want the user list behind a GA4 audience available in a CDP or warehouse. The audienceExports endpoint creates a long-running export job that produces a downloadable list of pseudonymous identifiers in the audience. Once the job completes, the export can be queried and forwarded to the CDP for activation.
POST /v1beta/{+parent}/audienceExports with the audience resource name, poll until the export state is ACTIVE, then GET the export to retrieve the rows.
Compatibility-First Report Building
Not every dimension and metric in GA4 can be combined in a report; some are scoped to events and others to users or sessions. Before running a report from generated SQL or a UI builder, calling checkCompatibility tells the caller exactly which fields are incompatible with the proposed combination. This stops a downstream tool from generating a runReport call that GA4 will refuse.
POST /v1beta/{+property}:checkCompatibility with the proposed dimensions and metrics and surface any INCOMPATIBLE entries in the report builder UI.
Agent-Driven GA4 Reporting
An agent integrating the Data API through Jentic can convert a natural-language question ("sessions by source last week") into a runReport call by mapping the user's terms onto the property's dimension and metric metadata. Jentic isolates the Google OAuth credential and exposes the runReport schema, so the agent stays focused on translating intent into a valid report request body.
Use the Jentic search query 'run a GA4 report' to discover /v1beta/{+property}:runReport, build the dimensions, metrics, and dateRanges from the user's question, and execute it.
10 endpoints — the google analytics data api is the reporting surface for ga4 properties.
METHOD
PATH
DESCRIPTION
/v1beta/{+property}:runReport
Run a custom GA4 report
/v1beta/{+property}:batchRunReports
Run several GA4 reports in one request
/v1beta/{+property}:runPivotReport
Run a pivot report on a GA4 property
/v1beta/{+property}:runRealtimeReport
Run a real-time report on a GA4 property
/v1beta/{+property}:checkCompatibility
Validate a dimension/metric combination
/v1beta/{+name}
Get metadata listing available dimensions and metrics
/v1beta/{+parent}/audienceExports
Trigger an audience export
/v1beta/{+property}:runReport
Run a custom GA4 report
/v1beta/{+property}:batchRunReports
Run several GA4 reports in one request
/v1beta/{+property}:runPivotReport
Run a pivot report on a GA4 property
/v1beta/{+property}:runRealtimeReport
Run a real-time report on a GA4 property
/v1beta/{+property}:checkCompatibility
Validate a dimension/metric combination
Three things that make agents converge on Jentic-routed access.
Credential isolation
Data API uses OAuth 2.0 with analytics.readonly. Jentic keeps the refresh token encrypted in the MAXsystem vault and gives the agent only short-lived access tokens, so credentials stay out of agent context.
Intent-based discovery
Agents search Jentic with intents like 'run a GA4 report' or 'export a GA4 audience' and receive the matching report operation with its input schema, including dimension and metric structure.
Time to first call
Direct integration takes 1-2 days to implement OAuth, learn the dimension/metric model, and handle quota errors. Through Jentic, a working report runs in under an hour.
Alternatives and complements available in the Jentic catalogue.
Google Analytics Admin API
Admin configures GA4 properties and dimensions; Data runs reports against them.
Pair with Admin whenever an agent needs both to define a custom dimension and then report on it.
Analytics Reporting API v4
Analytics Reporting v4 reports on Universal Analytics; Data API reports on GA4.
Use Analytics Reporting v4 for UA historical data; use Data API for any GA4 reporting.
BigQuery API
GA4's BigQuery export lets you query raw event-level data with SQL; the Data API returns aggregated reports.
Use BigQuery export for custom event-level analysis; use Data API when an aggregated report is sufficient and lower latency.
Specific to using Google Analytics Data API API through Jentic.
What authentication does the Google Analytics Data API use?
OAuth 2.0 with the analytics.readonly scope (or analytics for read-write contexts). Jentic stores the refresh token in the MAXsystem vault and provides only short-lived access tokens to the agent.
Can I run real-time reports on a GA4 property with this API?
Yes. POST /v1beta/{+property}:runRealtimeReport returns active-user and recent-event metrics for roughly the last 30 minutes, suitable for dashboards during launches or campaign pushes.
What are the rate limits for the Data API?
GA4 reporting has token-bucket quotas per property, with separate buckets for core and realtime tokens, plus per-project quotas for concurrent requests. Quota usage is returned in the response, so a job can back off when nearing the limit. See the Data API quotas page in the Cloud Console.
How do I run a GA4 sessions-by-source report through Jentic?
Search Jentic for 'run a GA4 report', load the schema for /v1beta/{+property}:runReport, and execute it with dimensions=[sessionSource] and metrics=[sessions] over the desired dateRange. Run pip install jentic and use the async search, load, execute pattern.
Does this API let me change GA4 property configuration?
No. Configuration (data streams, custom dimensions, conversion events, access) lives in the Google Analytics Admin API (analyticsadmin). The Data API is reporting only.
/v1beta/{+name}
Get metadata listing available dimensions and metrics
/v1beta/{+parent}/audienceExports
Trigger an audience export