|
| 1 | +--- |
| 2 | +title: Google Analytics |
| 3 | +description: Query GA4 analytics data and reports |
| 4 | +--- |
| 5 | + |
| 6 | +import { BlockInfoCard } from "@/components/ui/block-info-card" |
| 7 | + |
| 8 | +<BlockInfoCard |
| 9 | + type="google_analytics" |
| 10 | + color="#E0E0E0" |
| 11 | +/> |
| 12 | + |
| 13 | +{/* MANUAL-CONTENT-START:intro */} |
| 14 | +[Google Analytics](https://analytics.google.com) is Google's web and app analytics platform. Through Sim, your agents can query GA4 property data to automate reporting, monitoring, and analysis workflows. |
| 15 | + |
| 16 | +**The following Google Analytics Data API operations are included in this integration:** |
| 17 | + |
| 18 | +- **Run Report:** Generate customized reports with dimensions, metrics, date ranges, filters, and sorting. Supports pagination for large datasets. |
| 19 | +- **Run Realtime Report:** Get live data from the last 30 minutes, including active users, page views, and conversions in real time. |
| 20 | +- **Get Metadata:** Discover all available dimensions and metrics for a GA4 property, including their descriptions and categories. |
| 21 | + |
| 22 | +With these operations, your Sim agents can automate daily/weekly analytics reporting, monitor real-time traffic and conversions, build dashboards from GA4 data, detect anomalies in key metrics, and enrich workflows with analytics context—all without manual work in the Google Analytics UI. |
| 23 | +{/* MANUAL-CONTENT-END */} |
| 24 | + |
| 25 | + |
| 26 | +## Usage Instructions |
| 27 | + |
| 28 | +Integrate Google Analytics GA4 into your workflow. Run custom reports, get realtime data, and discover available dimensions and metrics. |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +## Tools |
| 33 | + |
| 34 | +### `google_analytics_run_report` |
| 35 | + |
| 36 | +Run a customized report on Google Analytics GA4 property data |
| 37 | + |
| 38 | +#### Input |
| 39 | + |
| 40 | +| Parameter | Type | Required | Description | |
| 41 | +| --------- | ---- | -------- | ----------- | |
| 42 | +| `propertyId` | string | Yes | The GA4 property ID \(e.g., 123456789\) | |
| 43 | +| `dimensions` | string | Yes | Comma-separated dimension names \(e.g., date,country,deviceCategory\). See GA4 dimensions reference. | |
| 44 | +| `metrics` | string | Yes | Comma-separated metric names \(e.g., activeUsers,sessions,screenPageViews\). See GA4 metrics reference. | |
| 45 | +| `startDate` | string | Yes | Start date in YYYY-MM-DD format, or relative dates like "7daysAgo", "30daysAgo", "yesterday" | |
| 46 | +| `endDate` | string | Yes | End date in YYYY-MM-DD format, or "today", "yesterday" | |
| 47 | +| `dimensionFilter` | string | No | Dimension filter as JSON \(e.g., \{"filter":\{"fieldName":"country","stringFilter":\{"value":"US"\}\}\}\) | |
| 48 | +| `metricFilter` | string | No | Metric filter as JSON \(e.g., \{"filter":\{"fieldName":"activeUsers","numericFilter":\{"operation":"GREATER_THAN","value":\{"int64Value":"100"\}\}\}\}\) | |
| 49 | +| `orderBys` | string | No | Order by specification as JSON array \(e.g., \[\{"metric":\{"metricName":"activeUsers"\},"desc":true\}\]\) | |
| 50 | +| `limit` | number | No | Maximum number of rows to return \(default: 10000, max: 250000\) | |
| 51 | +| `offset` | number | No | Starting row offset for pagination \(default: 0\) | |
| 52 | +| `keepEmptyRows` | boolean | No | Whether to include rows with all zero metric values | |
| 53 | +| `currencyCode` | string | No | Currency code for revenue metrics \(e.g., USD, EUR\) | |
| 54 | + |
| 55 | +#### Output |
| 56 | + |
| 57 | +| Parameter | Type | Description | |
| 58 | +| --------- | ---- | ----------- | |
| 59 | +| `dimensionHeaders` | array | Dimension column headers | |
| 60 | +| ↳ `name` | string | Dimension name | |
| 61 | +| `metricHeaders` | array | Metric column headers | |
| 62 | +| ↳ `name` | string | Metric name | |
| 63 | +| ↳ `type` | string | Metric data type | |
| 64 | +| `rows` | array | Report data rows | |
| 65 | +| ↳ `dimensionValues` | json | Array of dimension values for this row | |
| 66 | +| ↳ `metricValues` | json | Array of metric values for this row | |
| 67 | +| `rowCount` | number | Total number of rows in the result | |
| 68 | +| `metadata` | json | Report metadata including currency code and time zone | |
| 69 | +| ↳ `currencyCode` | string | Currency code used in the report | |
| 70 | +| ↳ `timeZone` | string | Time zone used in the report | |
| 71 | + |
| 72 | +### `google_analytics_run_realtime_report` |
| 73 | + |
| 74 | +Run a realtime report on Google Analytics GA4 property data from the last 30 minutes |
| 75 | + |
| 76 | +#### Input |
| 77 | + |
| 78 | +| Parameter | Type | Required | Description | |
| 79 | +| --------- | ---- | -------- | ----------- | |
| 80 | +| `propertyId` | string | Yes | The GA4 property ID \(e.g., 123456789\) | |
| 81 | +| `dimensions` | string | No | Comma-separated dimension names for realtime data \(e.g., unifiedScreenName,country,deviceCategory\) | |
| 82 | +| `metrics` | string | Yes | Comma-separated metric names \(e.g., activeUsers,screenPageViews,conversions\) | |
| 83 | +| `dimensionFilter` | string | No | Dimension filter as JSON | |
| 84 | +| `metricFilter` | string | No | Metric filter as JSON | |
| 85 | +| `limit` | number | No | Maximum number of rows to return \(default: 10000, max: 250000\) | |
| 86 | +| `startMinutesAgo` | number | No | Start of the time window in minutes ago \(default: 29, max: 29 for standard, 59 for 360\) | |
| 87 | +| `endMinutesAgo` | number | No | End of the time window in minutes ago \(default: 0, meaning now\) | |
| 88 | + |
| 89 | +#### Output |
| 90 | + |
| 91 | +| Parameter | Type | Description | |
| 92 | +| --------- | ---- | ----------- | |
| 93 | +| `dimensionHeaders` | array | Dimension column headers | |
| 94 | +| ↳ `name` | string | Dimension name | |
| 95 | +| `metricHeaders` | array | Metric column headers | |
| 96 | +| ↳ `name` | string | Metric name | |
| 97 | +| ↳ `type` | string | Metric data type | |
| 98 | +| `rows` | array | Realtime report data rows | |
| 99 | +| ↳ `dimensionValues` | json | Array of dimension values for this row | |
| 100 | +| ↳ `metricValues` | json | Array of metric values for this row | |
| 101 | +| `rowCount` | number | Total number of rows in the result | |
| 102 | + |
| 103 | +### `google_analytics_get_metadata` |
| 104 | + |
| 105 | +Get available dimensions, metrics, and their descriptions for a Google Analytics GA4 property |
| 106 | + |
| 107 | +#### Input |
| 108 | + |
| 109 | +| Parameter | Type | Required | Description | |
| 110 | +| --------- | ---- | -------- | ----------- | |
| 111 | +| `propertyId` | string | Yes | The GA4 property ID \(e.g., 123456789\). Use 0 to get universal metadata available across all properties. | |
| 112 | + |
| 113 | +#### Output |
| 114 | + |
| 115 | +| Parameter | Type | Description | |
| 116 | +| --------- | ---- | ----------- | |
| 117 | +| `dimensions` | array | Available dimensions for the property | |
| 118 | +| ↳ `apiName` | string | API name to use in report requests | |
| 119 | +| ↳ `uiName` | string | Human-readable display name | |
| 120 | +| ↳ `description` | string | Description of the dimension | |
| 121 | +| ↳ `category` | string | Category grouping | |
| 122 | +| `metrics` | array | Available metrics for the property | |
| 123 | +| ↳ `apiName` | string | API name to use in report requests | |
| 124 | +| ↳ `uiName` | string | Human-readable display name | |
| 125 | +| ↳ `description` | string | Description of the metric | |
| 126 | +| ↳ `category` | string | Category grouping | |
| 127 | +| ↳ `type` | string | Data type of the metric | |
| 128 | + |
| 129 | + |
0 commit comments