Automate Google Analytics tasks via Rube MCP (Composio): run reports, list accounts/properties, funnels, pivots, key events. Always search tools first for current schemas.
Add this skill
npx mdskills install sickn33/google-analytics-automationComprehensive GA4 automation guide with clear tool sequences, parameter details, and common pitfalls
1---2name: google-analytics-automation3description: "Automate Google Analytics tasks via Rube MCP (Composio): run reports, list accounts/properties, funnels, pivots, key events. Always search tools first for current schemas."4requires:5 mcp: [rube]6---78# Google Analytics Automation via Rube MCP910Automate Google Analytics 4 (GA4) reporting and property management through Composio's Google Analytics toolkit via Rube MCP.1112## Prerequisites1314- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)15- Active Google Analytics connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `google_analytics`16- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas1718## Setup1920**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.2122231. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds242. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `google_analytics`253. If connection is not ACTIVE, follow the returned auth link to complete Google OAuth264. Confirm connection status shows ACTIVE before running any workflows2728## Core Workflows2930### 1. List Accounts and Properties3132**When to use**: User wants to discover available GA4 accounts and properties3334**Tool sequence**:351. `GOOGLE_ANALYTICS_LIST_ACCOUNTS` - List all accessible GA4 accounts [Required]362. `GOOGLE_ANALYTICS_LIST_PROPERTIES` - List properties under an account [Required]3738**Key parameters**:39- `pageSize`: Number of results per page40- `pageToken`: Pagination token from previous response41- `filter`: Filter expression for properties (e.g., `parent:accounts/12345`)4243**Pitfalls**:44- Property IDs are numeric strings prefixed with 'properties/' (e.g., 'properties/123456')45- Account IDs are prefixed with 'accounts/' (e.g., 'accounts/12345')46- Always list accounts first, then properties under each account47- Pagination required for organizations with many properties4849### 2. Run Standard Reports5051**When to use**: User wants to query metrics and dimensions from GA4 data5253**Tool sequence**:541. `GOOGLE_ANALYTICS_LIST_PROPERTIES` - Get property ID [Prerequisite]552. `GOOGLE_ANALYTICS_GET_METADATA` - Discover available dimensions and metrics [Optional]563. `GOOGLE_ANALYTICS_CHECK_COMPATIBILITY` - Verify dimension/metric compatibility [Optional]574. `GOOGLE_ANALYTICS_RUN_REPORT` - Execute the report query [Required]5859**Key parameters**:60- `property`: Property ID (e.g., 'properties/123456')61- `dateRanges`: Array of date range objects with `startDate` and `endDate`62- `dimensions`: Array of dimension objects with `name` field63- `metrics`: Array of metric objects with `name` field64- `dimensionFilter` / `metricFilter`: Filter expressions65- `orderBys`: Sort order configuration66- `limit`: Maximum rows to return67- `offset`: Row offset for pagination6869**Pitfalls**:70- Date format is 'YYYY-MM-DD' or relative values like 'today', 'yesterday', '7daysAgo', '30daysAgo'71- Not all dimensions and metrics are compatible; use CHECK_COMPATIBILITY first72- Use GET_METADATA to discover valid dimension and metric names73- Maximum 9 dimensions per report request74- Row limit defaults vary; set explicitly for large datasets75- `offset` is for result pagination, not date pagination7677### 3. Run Batch Reports7879**When to use**: User needs multiple different reports from the same property in one call8081**Tool sequence**:821. `GOOGLE_ANALYTICS_LIST_PROPERTIES` - Get property ID [Prerequisite]832. `GOOGLE_ANALYTICS_BATCH_RUN_REPORTS` - Execute multiple reports at once [Required]8485**Key parameters**:86- `property`: Property ID (required)87- `requests`: Array of individual report request objects (same structure as RUN_REPORT)8889**Pitfalls**:90- Maximum 5 report requests per batch call91- All reports in a batch must target the same property92- Each individual report has the same dimension/metric limits as RUN_REPORT93- Batch errors may affect all reports; check individual report responses9495### 4. Run Pivot Reports9697**When to use**: User wants cross-tabulated data (rows vs columns) like pivot tables9899**Tool sequence**:1001. `GOOGLE_ANALYTICS_LIST_PROPERTIES` - Get property ID [Prerequisite]1012. `GOOGLE_ANALYTICS_RUN_PIVOT_REPORT` - Execute pivot report [Required]102103**Key parameters**:104- `property`: Property ID (required)105- `dateRanges`: Date range objects106- `dimensions`: All dimensions used in any pivot107- `metrics`: Metrics to aggregate108- `pivots`: Array of pivot definitions with `fieldNames`, `limit`, and `orderBys`109110**Pitfalls**:111- Dimensions used in pivots must also be listed in top-level `dimensions`112- Pivot `fieldNames` reference dimension names from the top-level list113- Complex pivots with many dimensions can produce very large result sets114- Each pivot has its own independent `limit` and `orderBys`115116### 5. Run Funnel Reports117118**When to use**: User wants to analyze conversion funnels and drop-off rates119120**Tool sequence**:1211. `GOOGLE_ANALYTICS_LIST_PROPERTIES` - Get property ID [Prerequisite]1222. `GOOGLE_ANALYTICS_RUN_FUNNEL_REPORT` - Execute funnel analysis [Required]123124**Key parameters**:125- `property`: Property ID (required)126- `dateRanges`: Date range objects127- `funnel`: Funnel definition with `steps` array128- `funnelBreakdown`: Optional dimension to break down funnel by129130**Pitfalls**:131- Funnel steps are ordered; each step defines a condition users must meet132- Steps use filter expressions similar to dimension/metric filters133- Open funnels allow entry at any step; closed funnels require sequential progression134- Funnel reports may take longer to process than standard reports135136### 6. Manage Key Events137138**When to use**: User wants to view or manage conversion events (key events) in GA4139140**Tool sequence**:1411. `GOOGLE_ANALYTICS_LIST_PROPERTIES` - Get property ID [Prerequisite]1422. `GOOGLE_ANALYTICS_LIST_KEY_EVENTS` - List all key events for the property [Required]143144**Key parameters**:145- `parent`: Property resource name (e.g., 'properties/123456')146- `pageSize`: Number of results per page147- `pageToken`: Pagination token148149**Pitfalls**:150- Key events were previously called "conversions" in GA4151- Property must have key events configured to return results152- Key event names correspond to GA4 event names153154## Common Patterns155156### ID Resolution157158**Account name -> Account ID**:159```1601. Call GOOGLE_ANALYTICS_LIST_ACCOUNTS1612. Find account by displayName1623. Extract name field (e.g., 'accounts/12345')163```164165**Property name -> Property ID**:166```1671. Call GOOGLE_ANALYTICS_LIST_PROPERTIES with filter1682. Find property by displayName1693. Extract name field (e.g., 'properties/123456')170```171172### Dimension/Metric Discovery173174```1751. Call GOOGLE_ANALYTICS_GET_METADATA with property ID1762. Browse available dimensions and metrics1773. Call GOOGLE_ANALYTICS_CHECK_COMPATIBILITY to verify combinations1784. Use verified dimensions/metrics in RUN_REPORT179```180181### Pagination182183- Reports: Use `offset` and `limit` for row pagination184- Accounts/Properties: Use `pageToken` from response185- Continue until `pageToken` is absent or `rowCount` reached186187### Common Dimensions and Metrics188189**Dimensions**: `date`, `city`, `country`, `deviceCategory`, `sessionSource`, `sessionMedium`, `pagePath`, `pageTitle`, `eventName`190191**Metrics**: `activeUsers`, `sessions`, `screenPageViews`, `eventCount`, `conversions`, `totalRevenue`, `bounceRate`, `averageSessionDuration`192193## Known Pitfalls194195**Property IDs**:196- Always use full resource name format: 'properties/123456'197- Numeric ID alone will cause errors198- Resolve property names to IDs via LIST_PROPERTIES199200**Date Ranges**:201- Format: 'YYYY-MM-DD' or relative ('today', 'yesterday', '7daysAgo', '30daysAgo')202- Data processing delay means today's data may be incomplete203- Maximum date range varies by property configuration204205**Compatibility**:206- Not all dimensions work with all metrics207- Always verify with CHECK_COMPATIBILITY before complex reports208- Custom dimensions/metrics have specific naming patterns209210**Response Parsing**:211- Report data is nested in `rows` array with `dimensionValues` and `metricValues`212- Values are returned as strings; parse numbers explicitly213- Empty reports return no `rows` key (not an empty array)214215## Quick Reference216217| Task | Tool Slug | Key Params |218|------|-----------|------------|219| List accounts | GOOGLE_ANALYTICS_LIST_ACCOUNTS | pageSize, pageToken |220| List properties | GOOGLE_ANALYTICS_LIST_PROPERTIES | filter, pageSize |221| Get metadata | GOOGLE_ANALYTICS_GET_METADATA | property |222| Check compatibility | GOOGLE_ANALYTICS_CHECK_COMPATIBILITY | property, dimensions, metrics |223| Run report | GOOGLE_ANALYTICS_RUN_REPORT | property, dateRanges, dimensions, metrics |224| Batch reports | GOOGLE_ANALYTICS_BATCH_RUN_REPORTS | property, requests |225| Pivot report | GOOGLE_ANALYTICS_RUN_PIVOT_REPORT | property, dateRanges, pivots |226| Funnel report | GOOGLE_ANALYTICS_RUN_FUNNEL_REPORT | property, dateRanges, funnel |227| List key events | GOOGLE_ANALYTICS_LIST_KEY_EVENTS | parent, pageSize |228
Full transparency — inspect the skill content before installing.