ga_run_report
Pack: google_analytics · Endpoint: https://gateway.pipeworx.io/google_analytics/mcp
Query GA4 analytics data by dimensions (e.g., “city”, “pagePath”) and metrics (e.g., “activeUsers”, “sessions”) for a date range. Returns aggregated data rows with dimension and metric values.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
property_id | string | yes | GA4 property ID (numeric, e.g., “123456789”) |
dimensions | array | no | List of dimension names (e.g., [“city”, “pagePath”, “date”]) |
items | string | no | |
metrics | array | yes | List of metric names (e.g., [“activeUsers”, “sessions”, “screenPageViews”]) |
items | string | no | |
start_date | string | yes | Start date (YYYY-MM-DD or relative: “today”, “yesterday”, “7daysAgo”, “30daysAgo”) |
end_date | string | yes | End date (YYYY-MM-DD or relative: “today”, “yesterday”) |
limit | number | no | Maximum number of rows to return (default 100, max 10000) |
dimension_filter | object | no | Optional dimension filter object (GA4 FilterExpression format) |
order_bys | array | no | Optional ordering. Each item: { dimension: { dimensionName, orderType? } } or { metric: { metricName }, desc? } |
item | unknown | no | |
dimension | unknown | no | |
metric | unknown | no | |
items | object | no |
Example call
Arguments
{
"property_id": "123456789",
"metrics": [
"activeUsers",
"sessions"
],
"start_date": "30daysAgo",
"end_date": "today"
}
curl
curl -X POST https://gateway.pipeworx.io/google_analytics/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"ga_run_report","arguments":{"property_id":"123456789","metrics":["activeUsers","sessions"],"start_date":"30daysAgo","end_date":"today"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('ga_run_report', {
"property_id": "123456789",
"metrics": [
"activeUsers",
"sessions"
],
"start_date": "30daysAgo",
"end_date": "today"
});
More examples
{
"property_id": "123456789",
"dimensions": [
"city",
"pagePath"
],
"metrics": [
"screenPageViews",
"bounceRate"
],
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"limit": 500,
"order_bys": [
{
"metric": {
"metricName": "screenPageViews"
},
"desc": true
}
]
}
Response shape
| Field | Type | Description |
|---|---|---|
dimensionHeaders | array | List of dimension names in the report |
metricHeaders | array | List of metric names and types in the report |
rows | array | Report data rows with dimension and metric values |
rowCount | number | Total number of rows returned |
error | string | Error message if connection failed |
message | string | Error details if connection failed |
Full JSON Schema
{
"type": "object",
"properties": {
"dimensionHeaders": {
"type": "array",
"description": "List of dimension names in the report",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Dimension name"
}
}
}
},
"metricHeaders": {
"type": "array",
"description": "List of metric names and types in the report",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Metric name"
},
"type": {
"type": "string",
"description": "Metric data type"
}
}
}
},
"rows": {
"type": "array",
"description": "Report data rows with dimension and metric values",
"items": {
"type": "object",
"properties": {
"dimensionValues": {
"type": "array",
"description": "Dimension values for this row",
"items": {
"type": "object",
"properties": {
"value": {
"type": "string",
"description": "Dimension value"
}
}
}
},
"metricValues": {
"type": "array",
"description": "Metric values for this row",
"items": {
"type": "object",
"properties": {
"value": {
"type": "string",
"description": "Metric value"
}
}
}
}
}
}
},
"rowCount": {
"type": "number",
"description": "Total number of rows returned"
},
"error": {
"type": "string",
"description": "Error message if connection failed"
},
"message": {
"type": "string",
"description": "Error details if connection failed"
}
}
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"google_analytics": {
"url": "https://gateway.pipeworx.io/google_analytics/mcp"
}
}
}
See Getting Started for client-specific install steps.