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
dimensionHeadersarrayList of dimension names in the report
metricHeadersarrayList of metric names and types in the report
rowsarrayReport data rows with dimension and metric values
rowCountnumberTotal number of rows returned
errorstringError message if connection failed
messagestringError 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.

Regenerated from source · build May 9, 2026