All guides

Guide

Connect Google Analytics to Hermes Agent or OpenClaw with Composio

Turn a vague traffic question into a repeatable GA4 report: connect the right Google account, identify the property first, and let the agent summarize the numbers without giving it permission to redesign your analytics setup.

A useful first job: explain yesterday's traffic

You open GA4 after a launch and see traffic move, but the useful question is not simply “how many users?” It is which channel, landing page, or campaign changed. A connected agent can fetch the report, compare it with the previous period, and write a short briefing. Keep the first run narrow so you can validate its property and definitions before scheduling anything.

Connect the managed integration

The hosted steps are identical for Hermes Agent and OpenClaw. Both use the same account-level Composio bridge in OpenClaw Launch.

  1. Sign in and open Dashboard → Integrations.
  2. Search for Google Analytics, select that exact card, and click Connect. Its Composio toolkit slug is google_analytics.
  3. Complete Google OAuth with an account that can view the intended GA4 property. Return to the dashboard and wait for the card to show Connected.
  4. Ask the agent to list accessible account summaries before requesting a report. This catches the common wrong-Google-account problem early.

Composio lists OAuth2 as the toolkit's authentication method and exposes both GA4 reporting and administration tools in its Google Analytics reference. Google's Data API overview confirms that API reporting uses the same report data and reporting-identity settings as the Analytics interface.

Discover actions, then read first

composio connections
composio search google_analytics account summaries
composio search google_analytics run report

Useful verified action identifiers include:

  • GOOGLE_ANALYTICS_LIST_ACCOUNT_SUMMARIES to discover accounts and properties.
  • GOOGLE_ANALYTICS_GET_METADATA to inspect supported dimensions and metrics.
  • GOOGLE_ANALYTICS_CHECK_COMPATIBILITY to test whether a proposed report combination is valid.
  • GOOGLE_ANALYTICS_RUN_REPORT for a standard historical report.
  • GOOGLE_ANALYTICS_RUN_REALTIME_REPORT for recent activity.

Have the agent inspect the live action schema instead of guessing parameter JSON. Google defines dimensions as attributes used to break down data and metrics as measurements; its runReport reference documents date ranges, filters, ordering, and report rows.

Use my connected Google Analytics account. List the available GA4 properties and stop. Do not create, update, or archive anything.

After you choose the property, follow with:

For that property, check compatibility and then report users, sessions, and key events for the last seven complete days versus the previous seven. Break results down by default channel group. Explain material changes and include the exact date ranges. Do not change Analytics configuration.

Build a workflow you can audit

A solid weekly workflow has four stages: identify the property, validate metric compatibility, run the report, and write conclusions beside the raw totals. Ask the agent to state its property ID, ranges, dimensions, and metrics in every briefing. That makes a surprising result reproducible in GA4 instead of turning the agent's prose into an unexplained number.

If you later export a summary to Sheets, ask for a proposed column layout first, then approve the write. Keep property administration separate. Actions such as creating custom dimensions or updating a property are powerful, but they are not necessary for routine reporting.

Troubleshooting Google Analytics

  • The expected property is missing: reconnect the Google account that actually has property access, or ask an Analytics administrator to grant it.
  • A report is empty: compare the same property, dates, dimensions, and metrics in GA4. Google notes that reports only display data the property recorded. Composio's toolkit troubleshooting guide recommends this provider-side comparison.
  • A dimension and metric fail together: run GOOGLE_ANALYTICS_CHECK_COMPATIBILITY or simplify the breakdown.
  • The agent finds very few tools or ToolNotFound: Composio recommends resolving the latest google_analytics toolkit version. Refresh tool discovery rather than inventing a replacement action.
  • GA4 and the briefing disagree: verify reporting identity, time zone, complete-day ranges, and whether one report is realtime while the other is processed historical data.

Self-hosted setup for Hermes Agent and OpenClaw

For an installation you run yourself, create a server in your own Composio project, select this app and the tools you need, and connect the intended account. Copy the complete generated MCP URL for that user. The examples below use Composio Platform MCP and a Composio project API key in x-api-key. An app password or provider API key belongs in the app connection flow, not in this header.

Set COMPOSIO_API_KEY in the environment of the agent process and replace the URL placeholder below. Merge the entry into your existing configuration. Keep your project key out of chat and source control. A connection on OpenClaw Launch does not automatically transfer to your own Composio project; Composio connections are scoped to their project and user.

Hermes Agent

Add the server under mcp_servers in ~/.hermes/config.yaml. You can set the environment variable in ~/.hermes/.env.

mcp_servers:
  composio:
    url: "YOUR_GENERATED_PLATFORM_MCP_URL"
    headers:
      x-api-key: "${COMPOSIO_API_KEY}"
    connect_timeout: 60
    timeout: 180

Run hermes mcp test composio to check discovery, then start a new session or use /reload-mcp in the Hermes CLI. See the Hermes MCP configuration reference for reload behavior and tool filters.

OpenClaw

Use a release with the native openclaw mcp commands. Its server definitions belong under mcp.servers in ~/.openclaw/openclaw.json:

{
  "mcp": {
    "servers": {
      "composio": {
        "url": "YOUR_GENERATED_PLATFORM_MCP_URL",
        "transport": "streamable-http",
        "headers": {
          "x-api-key": "${COMPOSIO_API_KEY}"
        }
      }
    }
  }
}

Ensure the Gateway service receives the environment variable, restarting that service after changing its environment. Run openclaw mcp doctor composio --probe and begin a new agent session. If your version lacks these commands, update before using this config. The native registry is separate from mcporter. See OpenClaw's MCP reference and HTTP transport fields.

Discovery confirms the MCP connection. Finish with this guide's first read request to check access to the actual app. The hosted composio shell commands earlier in this guide are supplied by OpenClaw Launch; a standalone MCP setup exposes tools through the agent's MCP client instead.

Frequently asked questions

Does the Google Analytics Composio integration work with Hermes Agent?

Yes. Managed Hermes Agent and OpenClaw instances use the same Integrations connection flow. The agent framework changes, but the connected Google account and Google Analytics toolkit do not.

Does this work with Universal Analytics?

This workflow is for GA4 properties. Google states that the Analytics Data API does not support legacy Universal Analytics properties.

Why did my report return no rows?

First confirm the property, date range, dimensions, and metrics in Google Analytics itself. No rows can be a valid result when the property did not record the requested event or when processing is incomplete.

Can the agent change my Analytics property?

The toolkit includes both reporting and administrative actions. Start with read-only report actions, review the plan, and authorize a write only when you intend to change the property.

Related guides

Connect Google Analytics to your agent

Use the managed integration for Hermes Agent or OpenClaw, then begin with a read-only GA4 report.

Open Integrations