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

NameTypeRequiredDescription
property_idstringyesGA4 property ID (numeric, e.g., “123456789”)
dimensionsarraynoList of dimension names (e.g., [“city”, “pagePath”, “date”])
itemsstringno
metricsarrayyesList of metric names (e.g., [“activeUsers”, “sessions”, “screenPageViews”])
itemsstringno
start_datestringyesStart date (YYYY-MM-DD or relative: “today”, “yesterday”, “7daysAgo”, “30daysAgo”)
end_datestringyesEnd date (YYYY-MM-DD or relative: “today”, “yesterday”)
limitnumbernoMaximum number of rows to return (default 100, max 10000)
dimension_filterobjectnoOptional dimension filter object (GA4 FilterExpression format)
order_bysarraynoOptional ordering. Each item: { dimension: { dimensionName, orderType? } } or { metric: { metricName }, desc? }
itemunknownno
dimensionunknownno
metricunknownno
itemsobjectno

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

FieldTypeDescription
dimensionHeadersarrayHeaders for dimension columns in the report
metricHeadersarrayHeaders for metric columns in the report
rowsarrayAggregated data rows with dimension and metric values
rowCountnumberTotal number of rows returned
kindstringAPI response kind identifier
errorstringError code if connection not established
messagestringError message if connection not established
Full JSON Schema
{
  "type": "object",
  "properties": {
    "dimensionHeaders": {
      "type": "array",
      "description": "Headers for dimension columns in the report",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Dimension name"
          }
        }
      }
    },
    "metricHeaders": {
      "type": "array",
      "description": "Headers for metric columns in the report",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Metric name"
          },
          "type": {
            "type": "string",
            "description": "Data type of metric"
          }
        }
      }
    },
    "rows": {
      "type": "array",
      "description": "Aggregated data rows with dimension and metric values",
      "items": {
        "type": "object",
        "properties": {
          "dimensionValues": {
            "type": "array",
            "description": "Dimension values for this row",
            "items": {
              "type": "object"
            }
          },
          "metricValues": {
            "type": "array",
            "description": "Metric values for this row",
            "items": {
              "type": "object"
            }
          }
        }
      }
    },
    "rowCount": {
      "type": "number",
      "description": "Total number of rows returned"
    },
    "kind": {
      "type": "string",
      "description": "API response kind identifier"
    },
    "error": {
      "type": "string",
      "description": "Error code if connection not established"
    },
    "message": {
      "type": "string",
      "description": "Error message if connection not established"
    }
  }
}

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.

Regenerated from source · build June 24, 2026