google-analytics-automation
通过Rube MCP(Composio)自动化Google Analytics任务:运行报告、列出账户/属性、漏斗分析、数据透视、关键事件追踪。始终优先使用工具搜索最新架构。
Google Analytics Automation via Rube MCP
Automate Google Analytics 4 (GA4) reporting and property management through Composio's Google Analytics toolkit via Rube MCP.
Prerequisites
RUBE_MANAGE_CONNECTIONS with toolkit google_analyticsRUBE_SEARCH_TOOLS first to get current tool schemasSetup
Get Rube MCP: Add https://rube.app/mcp as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
RUBE_SEARCH_TOOLS respondsRUBE_MANAGE_CONNECTIONS with toolkit google_analyticsCore Workflows
1. List Accounts and Properties
When to use: User wants to discover available GA4 accounts and properties
Tool sequence:
GOOGLE_ANALYTICS_LIST_ACCOUNTS - List all accessible GA4 accounts [Required]GOOGLE_ANALYTICS_LIST_PROPERTIES - List properties under an account [Required]Key parameters:
pageSize: Number of results per pagepageToken: Pagination token from previous responsefilter: Filter expression for properties (e.g., parent:accounts/12345)Pitfalls:
2. Run Standard Reports
When to use: User wants to query metrics and dimensions from GA4 data
Tool sequence:
GOOGLE_ANALYTICS_LIST_PROPERTIES - Get property ID [Prerequisite]GOOGLE_ANALYTICS_GET_METADATA - Discover available dimensions and metrics [Optional]GOOGLE_ANALYTICS_CHECK_COMPATIBILITY - Verify dimension/metric compatibility [Optional]GOOGLE_ANALYTICS_RUN_REPORT - Execute the report query [Required]Key parameters:
property: Property ID (e.g., 'properties/123456')dateRanges: Array of date range objects with startDate and endDatedimensions: Array of dimension objects with name fieldmetrics: Array of metric objects with name fielddimensionFilter / metricFilter: Filter expressionsorderBys: Sort order configurationlimit: Maximum rows to returnoffset: Row offset for paginationPitfalls:
offset is for result pagination, not date pagination3. Run Batch Reports
When to use: User needs multiple different reports from the same property in one call
Tool sequence:
GOOGLE_ANALYTICS_LIST_PROPERTIES - Get property ID [Prerequisite]GOOGLE_ANALYTICS_BATCH_RUN_REPORTS - Execute multiple reports at once [Required]Key parameters:
property: Property ID (required)requests: Array of individual report request objects (same structure as RUN_REPORT)Pitfalls:
4. Run Pivot Reports
When to use: User wants cross-tabulated data (rows vs columns) like pivot tables
Tool sequence:
GOOGLE_ANALYTICS_LIST_PROPERTIES - Get property ID [Prerequisite]GOOGLE_ANALYTICS_RUN_PIVOT_REPORT - Execute pivot report [Required]Key parameters:
property: Property ID (required)dateRanges: Date range objectsdimensions: All dimensions used in any pivotmetrics: Metrics to aggregatepivots: Array of pivot definitions with fieldNames, limit, and orderBysPitfalls:
dimensionsfieldNames reference dimension names from the top-level listlimit and orderBys5. Run Funnel Reports
When to use: User wants to analyze conversion funnels and drop-off rates
Tool sequence:
GOOGLE_ANALYTICS_LIST_PROPERTIES - Get property ID [Prerequisite]GOOGLE_ANALYTICS_RUN_FUNNEL_REPORT - Execute funnel analysis [Required]Key parameters:
property: Property ID (required)dateRanges: Date range objectsfunnel: Funnel definition with steps arrayfunnelBreakdown: Optional dimension to break down funnel byPitfalls:
6. Manage Key Events
When to use: User wants to view or manage conversion events (key events) in GA4
Tool sequence:
GOOGLE_ANALYTICS_LIST_PROPERTIES - Get property ID [Prerequisite]GOOGLE_ANALYTICS_LIST_KEY_EVENTS - List all key events for the property [Required]Key parameters:
parent: Property resource name (e.g., 'properties/123456')pageSize: Number of results per pagepageToken: Pagination tokenPitfalls:
Common Patterns
ID Resolution
Account name -> Account ID:
1. Call GOOGLE_ANALYTICS_LIST_ACCOUNTS
Find account by displayName
Extract name field (e.g., 'accounts/12345') Property name -> Property ID:
1. Call GOOGLE_ANALYTICS_LIST_PROPERTIES with filter
Find property by displayName
Extract name field (e.g., 'properties/123456') Dimension/Metric Discovery
1. Call GOOGLE_ANALYTICS_GET_METADATA with property ID
Browse available dimensions and metrics
Call GOOGLE_ANALYTICS_CHECK_COMPATIBILITY to verify combinations
Use verified dimensions/metrics in RUN_REPORT Pagination
offset and limit for row paginationpageToken from responsepageToken is absent or rowCount reachedCommon Dimensions and Metrics
Dimensions: date, city, country, deviceCategory, sessionSource, sessionMedium, pagePath, pageTitle, eventName
Metrics: activeUsers, sessions, screenPageViews, eventCount, conversions, totalRevenue, bounceRate, averageSessionDuration
Known Pitfalls
Property IDs:
Date Ranges:
Compatibility:
Response Parsing:
rows array with dimensionValues and metricValuesrows key (not an empty array)Quick Reference
| Task | Tool Slug | Key Params |
|---|---|---|
| List accounts | GOOGLE_ANALYTICS_LIST_ACCOUNTS | pageSize, pageToken |
| List properties | GOOGLE_ANALYTICS_LIST_PROPERTIES | filter, pageSize |
| Get metadata | GOOGLE_ANALYTICS_GET_METADATA | property |
| Check compatibility | GOOGLE_ANALYTICS_CHECK_COMPATIBILITY | property, dimensions, metrics |
| Run report | GOOGLE_ANALYTICS_RUN_REPORT | property, dateRanges, dimensions, metrics |
| Batch reports | GOOGLE_ANALYTICS_BATCH_RUN_REPORTS | property, requests |
| Pivot report | GOOGLE_ANALYTICS_RUN_PIVOT_REPORT | property, dateRanges, pivots |
| Funnel report | GOOGLE_ANALYTICS_RUN_FUNNEL_REPORT | property, dateRanges, funnel |
| List key events | GOOGLE_ANALYTICS_LIST_KEY_EVENTS | parent, pageSize |