Google Analytics 4
The 35 read-only tools Pilot MCP serves for Google Analytics 4, taken from the server.
Pilot MCP serves 35 tools for Google Analytics 4, all read-only. Their names start with google_analytics_. The connector's 31 write tools are not served: Pilot MCP is read-only.
Google Analytics 4, read-only: reports (standard, pivot, realtime, funnel), properties and streams, key events, dimensions and metrics, audiences, links and access.
What each entry shows
The name, description and parameters come from the list the server serves to your assistant (tools/list). Descriptions are in English: this is the text your assistant receives. Your assistant never fills in platform credentials: Pilot adds them on each call.
Tool families
| Family | Tools |
|---|---|
| Audiences | 6 |
| Key events, dimensions and metrics | 9 |
| Links and access | 4 |
| Properties and streams | 8 |
| Reports | 8 |
Audiences
google_analytics_get_audience
Google Analytics: Get Audience · read-only · idempotent
Get details of a single audience by its ID. Returns the audience's display name, description, membership duration, event trigger, exclusion duration mode, and filter clauses. Example: get_audience({ propertyId: "123456789", audienceId: "1234" })
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID. |
audienceId | string | yes | Audience ID (numeric string), e.g. "1234". |
google_analytics_get_audience_export
Google Analytics: Get Audience Export · read-only · idempotent
Get the status and metadata of an audience export.
Full description, as the server serves it
Get the status and metadata of an audience export.
Use this after calling create_audience_export to check whether the export has
completed processing. The response includes:
- name: resource name of the export
- audience: which audience was exported
- audienceDisplayName: human-readable name
- state: "CREATING", "ACTIVE", "FAILED"
- beginCreatingTime / creationQuotaTokensCharged
- rowCount: number of users in the export (once active)
- dimensions: which dimensions were requested
Poll this endpoint until state === "ACTIVE" before calling query_audience_export.
Full reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/get| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID. |
audienceExportId | string | yes | The audience export ID (numeric), e.g. "12345". The full resource name is constructed automatically. |
google_analytics_get_expanded_data_set
Google Analytics: Get Expanded Data Set · read-only · idempotent
Retrieves a single expanded data set by its ID for a GA4 property. Returns the full expanded data set resource including its display name, dimension names, metric names, and dimension filter expression.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string or number | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID (e.g. 123456789 or "properties/123456789"). |
expandedDataSetId | string | yes | The ID of the expanded data set to retrieve. |
google_analytics_list_audience_exports
Google Analytics: List Audience Exports · read-only · idempotent
List all audience exports for a GA4 property.
Full description, as the server serves it
List all audience exports for a GA4 property.
Returns an array of audience export resources with their current state,
audience info, dimensions, and row counts. Useful for discovering existing
exports or checking on multiple exports at once.
Each export in the list includes:
- name: full resource name
- audience / audienceDisplayName
- state: "CREATING", "ACTIVE", or "FAILED"
- dimensions, rowCount, creation time, etc.
Full reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/list| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. "123456789" or "properties/123456789". |
google_analytics_list_audiences
Google Analytics: List Audiences · read-only · idempotent
List all audiences defined on a GA4 property. Returns each audience's resource name, display name, description, membership duration, and filter clauses. Example: list_audiences({ propertyId: "123456789" })
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. "123456789" or "properties/123456789". |
google_analytics_list_expanded_data_sets
Google Analytics: List Expanded Data Sets · read-only · idempotent
Lists all expanded data sets for a GA4 property. Expanded data sets allow you to create pre-defined combinations of dimensions and metrics that can be used for reporting. Returns an array of expanded data set resources including their display names, dimension names, and metric names.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string or number | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID (e.g. 123456789 or "properties/123456789"). |
Key events, dimensions and metrics
google_analytics_get_channel_group
Google Analytics: Get Channel Group · read-only · idempotent
Retrieves a single custom channel group by its ID. Returns the full channel group resource including display name, description, and all grouping rules that define how traffic is categorized.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID (e.g. "123456789" or "properties/123456789"). |
channelGroupId | string | yes | The channel group ID to retrieve. |
google_analytics_get_custom_dimension
Google Analytics: Get Custom Dimension · read-only · idempotent
Retrieves a single custom dimension by its ID for a GA4 property. Returns the full custom dimension resource including parameter name, display name, scope, and description.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string or number | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID (e.g. 123456789 or "properties/123456789"). |
customDimensionId | string | yes | The ID of the custom dimension to retrieve. |
google_analytics_get_custom_dimensions_and_metrics
Google Analytics: Get Custom Dimensions and Metrics · read-only · idempotent
Retrieve only the custom dimensions and custom metrics defined for a GA4 property.
Full description, as the server serves it
Retrieve only the custom dimensions and custom metrics defined for a GA4 property.
This is a convenience wrapper around get_metadata that filters results to only
include fields where customDefinition === true.
Returns:
{
custom_dimensions: [ {apiName, uiName, description, ...}, ... ],
custom_metrics: [ {apiName, uiName, description, ...}, ... ]
}
Custom dimensions/metrics are those you define yourself in GA4 Admin > Custom definitions.
They typically have apiNames like "customEvent:my_param" or "customUser:my_property".
Use this when you need to discover property-specific custom fields for reporting.
Full reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. "123456789" or "properties/123456789". |
google_analytics_get_custom_metric
Google Analytics: Get Custom Metric · read-only · idempotent
Retrieves a single custom metric by its ID for a GA4 property. Returns the full custom metric resource including parameter name, display name, scope, measurement unit, and description.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string or number | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID (e.g. 123456789 or "properties/123456789"). |
customMetricId | string | yes | The ID of the custom metric to retrieve. |
google_analytics_get_key_event
Google Analytics: Get Key Event · read-only · idempotent
Get details of a single key event by its ID. Returns the event name, counting method, default value, and timestamps. Example: get_key_event({ propertyId: "123456789", keyEventId: "5678" })
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID. |
keyEventId | string | yes | Key event ID (numeric string), e.g. "5678". |
google_analytics_list_channel_groups
Google Analytics: List Channel Groups · read-only · idempotent
Lists all custom channel groups defined on a GA4 property. Channel groups let you organize traffic sources into meaningful categories for reporting. Returns an array of channel group resources including their display names, descriptions, and grouping rules.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID (e.g. "123456789" or "properties/123456789"). |
google_analytics_list_custom_dimensions
Google Analytics: List Custom Dimensions · read-only · idempotent
Lists all custom dimensions for a GA4 property. Returns an array of custom dimension resources including their parameter names, display names, scopes, and descriptions.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string or number | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID (e.g. 123456789 or "properties/123456789"). |
google_analytics_list_custom_metrics
Google Analytics: List Custom Metrics · read-only · idempotent
Lists all custom metrics for a GA4 property. Returns an array of custom metric resources including their parameter names, display names, scopes, measurement units, and descriptions.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string or number | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID (e.g. 123456789 or "properties/123456789"). |
google_analytics_list_key_events
Google Analytics: List Key Events · read-only · idempotent
List all key events (conversions) configured on a GA4 property. Returns each key event's resource name, event name, counting method, create/update times, and default value settings. Example: list_key_events({ propertyId: "123456789" })
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. "123456789" or "properties/123456789". |
Links and access
google_analytics_get_firebase_link
Google Analytics: Get Firebase Link · read-only · idempotent
Get details for a specific Firebase link on a GA4 property. Returns the link's Firebase project ID, creation timestamp, and full resource name.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. '123456789' or 'properties/123456789'. |
firebaseLinkId | string | yes | The Firebase link ID to retrieve. |
google_analytics_get_google_ads_link
Google Analytics: Get Google Ads Link · read-only · idempotent
Get details for a specific Google Ads link on a GA4 property. Returns the link's Google Ads customer ID, ads personalization setting, creator email address, and creation timestamp.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. '123456789' or 'properties/123456789'. |
googleAdsLinkId | string | yes | The Google Ads link ID to retrieve. |
google_analytics_list_firebase_links
Google Analytics: List Firebase Links · read-only · idempotent
List all Firebase links for a GA4 property. Returns each link's Firebase project ID, creation timestamp, and resource name. Useful for auditing which Firebase projects are connected to a property.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. '123456789' or 'properties/123456789'. |
google_analytics_list_google_ads_links
Google Analytics: List Google Ads Links · read-only · idempotent
List all Google Ads links for a GA4 property. Returns each link's Google Ads customer ID, ads personalization setting, creator email, and creation timestamp. Useful for auditing which Google Ads accounts are connected to a property.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. '123456789' or 'properties/123456789'. |
Properties and streams
google_analytics_get_account_summaries
Google Analytics: Get Account Summaries · read-only · idempotent
List summaries of all Google Analytics 4 accounts and their properties accessible to the authenticated user. Each summary includes the account name, display name, and a list of property summaries (property ID, display name, and property type). Useful for getting a quick overview of the entire account hierarchy without fetching full details.
| Parameter | Type | Required | Description |
|---|---|---|---|
account_id | string | no | Google Analytics property to use when the workspace has several, as returned by the property listing tool. Default: the first property linked to the workspace. |
google_analytics_get_data_stream
Google Analytics: Get Data Stream · read-only · idempotent
Get details for a specific data stream under a Google Analytics 4 property. Returns the data stream type, display name, stream ID, measurement ID (for web streams), creation time, and update time. The propertyId can be a plain numeric ID (e.g. "123456") or the full resource name (e.g. "properties/123456").
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. '123456' or 'properties/123456'. |
dataStreamId | string | yes | Data stream ID, e.g. '1000001'. |
google_analytics_get_enhanced_measurement_settings
Google Analytics: Get Enhanced Measurement Settings · read-only · idempotent
Retrieves the enhanced measurement settings for a specific web data stream on a GA4 property. Enhanced measurement automatically tracks common user interactions such as page views, scrolls, outbound clicks, site search, video engagement, file downloads, page changes (history events), and form interactions - without requiring additional code. Returns the current enabled/disabled state of each enhanced measurement feature.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID (e.g. "123456789" or "properties/123456789"). |
dataStreamId | string | yes | The web data stream ID whose enhanced measurement settings to retrieve. |
google_analytics_get_property
Google Analytics: Get Property · read-only · idempotent
Retrieve detailed information about a single GA4 property, including its display name, create time, update time, time zone, currency code, service level, and industry category.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. The GA4 property ID (e.g. "123456789" or "properties/123456789"). |
google_analytics_list_data_streams
Google Analytics: List Data Streams · read-only · idempotent
List all data streams under a Google Analytics 4 property. Returns details for each data stream including its type (web, Android app, or iOS app), display name, stream ID, measurement ID (for web), and creation/update timestamps. Use this to discover which data streams are configured for a property.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. '123456' or 'properties/123456'. |
google_analytics_list_properties
Google Analytics: List Properties · read-only · idempotent
List all GA4 properties under a given account. Returns property IDs, display names, time zones, currency codes, and other metadata for every property the caller can access.
| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | yes | The GA4 account ID (e.g. "123456789" or "accounts/123456789"). |
account_id | string | no | Google Analytics property to use when the workspace has several, as returned by the property listing tool. Default: the first property linked to the workspace. |
google_analytics_list_property_annotations
Google Analytics: List Property Annotations · read-only · idempotent
Lists all reporting data annotations on a GA4 property. Annotations are date-stamped notes that provide context for data changes (e.g. marketing launches, site changes, external events). Useful for understanding why metrics shifted on specific dates. NOTE: This endpoint may require the Analytics Admin API alpha.
| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID (e.g. "123456789" or "properties/123456789"). |
google_analytics_search_change_history_events
Google Analytics: Search Change History Events · read-only · idempotent
Search change history events for a Google Analytics 4 account. Returns a list of changes made to the account and its child resources (properties, data streams, etc.), including who made the change and when.
Full description, as the server serves it
Search change history events for a Google Analytics 4 account. Returns a list of changes made to the account and its child resources (properties, data streams, etc.), including who made the change and when.
Parameters:
- accountId (required): The account to search, e.g. "123456" or "accounts/123456".
- propertyId (optional): Narrow results to a specific property, e.g. "properties/123456".
- resourceType (optional): Filter by resource types. Values include:
"ACCOUNT", "PROPERTY", "FIREBASE_LINK", "GOOGLE_ADS_LINK",
"CONVERSION_EVENT", "CUSTOM_DIMENSION", "CUSTOM_METRIC",
"DATA_RETENTION_SETTINGS", "DATA_STREAM", etc.
Example: ["PROPERTY", "DATA_STREAM"]
- action (optional): Filter by change actions. Values: "CREATED", "UPDATED", "DELETED".
Example: ["CREATED", "UPDATED"]
- earliestChangeTime (optional): ISO 8601 date string, e.g. "2024-01-01T00:00:00Z".
- latestChangeTime (optional): ISO 8601 date string, e.g. "2024-12-31T23:59:59Z".
- pageSize (optional): Maximum number of results to return.| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | yes | Account ID, e.g. '123456' or 'accounts/123456'. |
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. Optional property resource name to filter by, e.g. 'properties/123456'. |
resourceType | string[] | no | Optional list of resource types to filter by, e.g. ["PROPERTY","DATA_STREAM"]. |
action | string[] | no | Optional list of change actions to filter by, e.g. ["CREATED","UPDATED","DELETED"]. |
earliestChangeTime | string | no | Optional earliest change time as ISO 8601 string, e.g. "2024-01-01T00:00:00Z". |
latestChangeTime | string | no | Optional latest change time as ISO 8601 string, e.g. "2024-12-31T23:59:59Z". |
pageSize | number | no | Optional maximum number of results to return. |
Reports
google_analytics_batch_run_pivot_reports
Google Analytics: Batch Run Pivot Reports · read-only · idempotent
Run up to 5 GA4 pivot reports in a single batch request.
Full description, as the server serves it
Run up to 5 GA4 pivot reports in a single batch request.
Each request in the array follows the same schema as run_pivot_report
(dateRanges, dimensions, metrics, pivots, filters, etc.).
Useful for running multiple pivot analyses (e.g. different date ranges or dimension
combinations) with a single API call.
Full reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/batchRunPivotReports| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID. |
requests | object[] | yes | Array of pivot report requests (max 5). |
google_analytics_batch_run_reports
Google Analytics: Batch Run Reports · read-only · idempotent
Run up to 5 GA4 reports in a single batch request. Each request object follows the same schema as run_report (dateRanges, dimensions, metrics, filters, orderBys, etc.).
Full description, as the server serves it
Run up to 5 GA4 reports in a single batch request. Each request object follows the same
schema as run_report (dateRanges, dimensions, metrics, filters, orderBys, etc.).
Batching is useful when you need several related reports for the same property and want
to minimise API round-trips and quota usage.
Full reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/batchRunReports
Each request in the array should have:
- dateRanges: [{startDate, endDate, name?}, ...]
- dimensions: ["dim1", "dim2", ...]
- metrics: ["metric1", "metric2", ...]
- dimensionFilter (optional): FilterExpression object
- metricFilter (optional): FilterExpression object
- orderBys (optional): [{dimension:{dimensionName}, desc?}, ...]
- limit (optional): max rows per sub-report
- offset (optional): row offset
- currencyCode (optional)
- keepEmptyRows (optional)
- returnPropertyQuota (optional)
See run_report tool description for detailed examples of filters and ordering.| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID. |
requests | object[] | yes | Array of report requests (max 5). |
google_analytics_check_compatibility
Google Analytics: Check Compatibility · read-only · idempotent
Check whether specific dimensions and metrics can be used together in a GA4 report.
Full description, as the server serves it
Check whether specific dimensions and metrics can be used together in a GA4 report.
Not all dimension/metric combinations are compatible. This tool lets you validate
a proposed report configuration before running it.
Returns:
- dimensionCompatibilities: for each dimension, whether it is compatible.
- metricCompatibilities: for each metric, whether it is compatible.
Example use case: You want to report on "sessionSource" + "itemName" + "sessions" +
"itemRevenue" - call check_compatibility first to verify the combination is valid.
Full reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/checkCompatibility| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID. |
dimensions | string[] | no | Dimension names to check, e.g. ["date","country","sessionSource"]. |
metrics | string[] | no | Metric names to check, e.g. ["sessions","totalUsers","bounceRate"]. |
dimensionFilter | object | no | GA4 FilterExpression object. See run_report tool for detailed examples. |
metricFilter | any | no | GA4 FilterExpression object. See run_report tool for detailed examples. |
google_analytics_get_metadata
Google Analytics: Get Metadata · read-only · idempotent
Retrieve all available dimensions and metrics for a GA4 property.
Full description, as the server serves it
Retrieve all available dimensions and metrics for a GA4 property.
Returns the complete metadata catalogue including:
- All standard dimensions and metrics available for the property.
- Custom dimensions and metrics (marked with customDefinition: true).
- API name, UI name, description, category, and data type for each.
This is the authoritative source for which dimensions/metrics are valid
when building reports for a specific property. Different properties may
have different available fields depending on configuration.
Use this before building a report to discover exact field names.
Full reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. "123456789" or "properties/123456789". |
google_analytics_run_funnel_report
Google Analytics: Run Funnel Report · read-only · idempotent
Run a funnel report to analyze user conversion paths through defined steps. This is an alpha API feature. Each funnel step defines a condition users must meet. The report shows how users progress through (or drop off from) each step.
Full description, as the server serves it
Run a funnel report to analyze user conversion paths through defined steps. This is an alpha API feature. Each funnel step defines a condition users must meet. The report shows how users progress through (or drop off from) each step.
The funnel configuration requires a 'steps' array where each step has:
- 'name': A label for the step (e.g. "First visit", "Add to cart", "Purchase").
- 'filterExpression': An object describing the condition (andGroup, orGroup, notExpression, funnelFieldFilter, or funnelEventFilter).
Optional funnel-level fields:
- 'isOpenFunnel' (boolean, default false): When true, users can enter the funnel at any step rather than only the first.
You can also provide:
- funnelBreakdown: Adds a dimension to break down each step (e.g. by deviceCategory).
- funnelNextAction: Shows what users did after each step.
Response includes 'funnelTable' (tabular data) and 'funnelVisualization' (summary counts per step).
NOTE: This is an alpha API. If you receive a NOT_FOUND or UNIMPLEMENTED error, the alpha API may not be enabled for this property.
Full reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties/runFunnelReport| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. '123456789'. |
dateRanges | object[] | yes | Date ranges for the funnel report, e.g. [{"startDate":"2024-01-01","endDate":"2024-01-31"}]. |
funnel | object | yes | Funnel configuration object. Must include 'steps' array where each step has 'name' (string) and 'filterExpression' (object with andGroup/orGroup/notExpression/funnelFieldFilter/funnelEventFilter). Optional: 'isOpenFunnel' (boolean, default false). |
funnelBreakdown | object | no | Optional breakdown dimension for the funnel. Object with 'breakdownDimension' containing 'name' (string, e.g. 'deviceCategory') and optional 'limit' (number). |
funnelNextAction | object | no | Optional next action dimension. Object with 'nextActionDimension' containing 'name' (string) and optional 'limit' (number). |
limit | number | no | Maximum number of rows to return. |
google_analytics_run_pivot_report
Google Analytics: Run Pivot Report · read-only · idempotent
Run a GA4 pivot report. Pivot reports create cross-tabulations (like Excel pivot tables) by rotating dimension values into column headers.
Full description, as the server serves it
Run a GA4 pivot report. Pivot reports create cross-tabulations (like Excel pivot tables)
by rotating dimension values into column headers.
This is ideal for creating tables where:
- Rows represent one dimension (e.g. country)
- Columns represent another dimension (e.g. device category)
- Cells contain metric values (e.g. sessions)
PIVOTS - each pivot defines a set of dimensions to rotate into columns:
Example: {fieldNames: ["deviceCategory"], limit: 3}
This creates columns for the top 3 device categories.
Multiple pivots can be used to create multi-level column headers:
pivots: [
{fieldNames: ["browser"], limit: 5},
{fieldNames: ["deviceCategory"], limit: 3}
]
DIMENSIONS & METRICS - same as run_report. All dimensions referenced by pivots
must be included in the top-level dimensions array.
Reference: https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema
DATE RANGES - same as run_report.
Example: [{startDate: "30daysAgo", endDate: "yesterday"}]
Full reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runPivotReport| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. "123456789". |
dateRanges | object[] | yes | One or more date ranges. |
dimensions | string[] | yes | All dimension names (must include those referenced in pivots). |
metrics | string[] | yes | Metric names, e.g. ["sessions","totalUsers"]. |
pivots | object[] | yes | Pivot definitions (at least one required). |
dimensionFilter | object | no | GA4 FilterExpression object. See run_report tool for detailed examples. Docs: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/FilterExpression. |
metricFilter | any | no | GA4 FilterExpression object. See run_report tool for detailed examples. Docs: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/FilterExpression. |
currencyCode | string | no | Currency code, e.g. "USD". |
keepEmptyRows | boolean | no | Include rows where all metrics are zero. |
returnPropertyQuota | boolean | no | Return quota usage info. |
google_analytics_run_realtime_report
Google Analytics: Run Realtime Report · read-only · idempotent
Run a GA4 realtime report. Returns data about activity on the property within the last 30 minutes (or up to 60 minutes for some dimensions/metrics).
Full description, as the server serves it
Run a GA4 realtime report. Returns data about activity on the property within the last 30 minutes
(or up to 60 minutes for some dimensions/metrics).
REALTIME DIMENSIONS - a subset of standard dimensions plus realtime-specific ones.
Reference: https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#dimensions
Common examples:
"city", "country", "deviceCategory", "platform", "unifiedScreenName",
"unifiedScreenClass", "audienceName", "minutesAgo",
"streamName", "eventName", "conversions".
REALTIME METRICS - realtime-specific metrics.
Reference: https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#metrics
Common examples:
"activeUsers", "screenPageViews", "eventCount", "conversions",
"keyEvents".
NOTE: Realtime reports do NOT accept dateRanges - data always covers the
last 30 minutes of activity.
DIMENSION FILTER - same FilterExpression structure as regular reports:
String filter: {"filter":{"fieldName":"country","stringFilter":{"matchType":"EXACT","value":"United States"}}}
In-list: {"filter":{"fieldName":"eventName","inListFilter":{"values":["page_view","scroll"]}}}
ORDER BYS:
[{"metric":{"metricName":"activeUsers"},"desc":true}]
Full reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runRealtimeReport| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. "123456789". |
dimensions | string[] | no | Realtime dimension names. See https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#dimensions. |
metrics | string[] | no | Realtime metric names. See https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#metrics. |
dimensionFilter | object | no | GA4 FilterExpression object. Same structure as regular reports. See run_report tool for detailed filter examples. |
metricFilter | any | no | GA4 FilterExpression object. Same structure as regular reports. See run_report tool for detailed filter examples. |
orderBys | object[] | no | Ordering specification. |
limit | number | no | Max rows to return. |
returnPropertyQuota | boolean | no | Return quota usage info. |
google_analytics_run_report
Google Analytics: Run Report · read-only · idempotent
Run a standard GA4 report. Returns rows of dimension/metric values for the given property.
Full description, as the server serves it
Run a standard GA4 report. Returns rows of dimension/metric values for the given property.
DIMENSIONS - name strings from the GA4 schema.
Reference: https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions
Common examples: "date", "city", "country", "sessionSource", "sessionMedium",
"sessionDefaultChannelGroup", "pagePath", "pageTitle", "eventName",
"deviceCategory", "operatingSystem", "browser", "language",
"firstUserSource", "firstUserMedium", "unifiedScreenName".
METRICS - name strings from the GA4 schema.
Reference: https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics
Common examples: "sessions", "totalUsers", "newUsers", "activeUsers",
"screenPageViews", "engagedSessions", "engagementRate",
"averageSessionDuration", "eventCount", "conversions",
"totalRevenue", "bounceRate", "sessionsPerUser".
DATE RANGES - each with startDate and endDate.
Examples:
{startDate: "2025-01-01", endDate: "2025-01-31"}
{startDate: "30daysAgo", endDate: "yesterday"}
{startDate: "7daysAgo", endDate: "today"}
DIMENSION FILTER - a FilterExpression JSON object. Examples:
String filter: {"filter":{"fieldName":"country","stringFilter":{"matchType":"EXACT","value":"United States"}}}
In-list filter: {"filter":{"fieldName":"eventName","inListFilter":{"values":["page_view","scroll"]}}}
Numeric filter: {"filter":{"fieldName":"sessions","numericFilter":{"operation":"GREATER_THAN","value":{"int64Value":"100"}}}}
AND group: {"andGroup":{"expressions":[...]}}
OR group: {"orGroup":{"expressions":[...]}}
ORDER BYS - array of ordering objects. Examples:
By dimension (ascending): [{"dimension":{"dimensionName":"date"}}]
By metric (descending): [{"metric":{"metricName":"sessions"},"desc":true}]
Full API reference: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runReport| Parameter | Type | Required | Description |
|---|---|---|---|
propertyId | string | no | Optional: defaults to the first property linked to this Pilot workspace. GA4 property ID, e.g. "123456789" or "properties/123456789". |
dateRanges | object[] | yes | One or more date ranges for the report. |
dimensions | string[] | yes | Dimension names to include, e.g. ["date","country"]. |
metrics | string[] | yes | Metric names to include, e.g. ["sessions","totalUsers"]. |
dimensionFilter | object | no | A GA4 FilterExpression object (recursive). Examples: - String filter: {"filter":{"fieldName":"country","stringFilter":{"matchType":"EXACT","value":"United States"}}} - In-list filter: {"filter":{"fieldName":"eventName","inListFilter":{"values":["page_view","scroll"]}}} - Numeric filter: {"filter":{"fieldName":"sessions","numericFilter":{"operation":"GREATER_THAN","value":{"int64Value":"100"}}}} - AND group: {"andGroup":{"expressions":[<FilterExpression>,...]}} - OR group: {"orGroup":{"expressions":[<FilterExpression>,...]}} - NOT: {"notExpression":<FilterExpression>} See https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/FilterExpression. |
metricFilter | any | no | A GA4 FilterExpression object (recursive). Examples: - String filter: {"filter":{"fieldName":"country","stringFilter":{"matchType":"EXACT","value":"United States"}}} - In-list filter: {"filter":{"fieldName":"eventName","inListFilter":{"values":["page_view","scroll"]}}} - Numeric filter: {"filter":{"fieldName":"sessions","numericFilter":{"operation":"GREATER_THAN","value":{"int64Value":"100"}}}} - AND group: {"andGroup":{"expressions":[<FilterExpression>,...]}} - OR group: {"orGroup":{"expressions":[<FilterExpression>,...]}} - NOT: {"notExpression":<FilterExpression>} See https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/FilterExpression. |
orderBys | object[] | no | Ordering specification for the result rows. |
limit | number | no | Max rows to return (default API limit applies). Max 250 000. |
offset | number | no | Row offset for pagination. |
currencyCode | string | no | Currency code for revenue metrics, e.g. "USD". |
keepEmptyRows | boolean | no | If true, include rows where all metrics are zero. |
returnPropertyQuota | boolean | no | If true, include quota usage info in the response. |