All templates
FeaturedIntegration#Google Analytics#MCP#Agent#Analytics#Data#Marketing

Google Analytics AI Agent

Ask plain-language questions about your GA4 property — the Agent queries Google Analytics through analytics-mcp and returns metrics, reports, and insights.

Workflow at a glance

The full canvas, before you import it

Click any node to see its config.

#Google Analytics#MCP#Agent#Analytics#Data#Marketing

Click a node to select it — same as the Heym editor; the panel shows its settings.

3 nodes · Free & source-available

Google Analytics AI Agent

Ask plain-language questions about your GA4 property and get back metrics, segments, and reports without opening a dashboard.

What this workflow does

  1. AnalyticsQuery — type a free-text question about your site traffic
  2. AnalyticsAgent — an Agent queries GA4 through the analytics-mcp MCP server and formats the answer
  3. AnalyticsResult — returns the Agent's response

Use cases

  • "What were my top landing pages last week?"
  • "Show me traffic by country for the past 30 days"
  • "Compare mobile vs desktop sessions this month vs last month"
  • "Which pages have the highest bounce rate?"
  • "How many new users did we get this week vs last week?"

Service account setup

  1. Go to Google Cloud Console → IAM & Admin → Service Accounts
  2. Create a service account (e.g. [email protected])
  3. Enable the Google Analytics Data API in APIs & Services → Library
  4. Download a JSON key for the service account (Actions → Manage keys → Add key → JSON)
  5. In Google Analytics, go to Admin → Account Access Management → Add users, and add the service account email as a Viewer
  6. Base64-encode the key: base64 < service-account.json | tr -d '\n'
  7. Paste the result into the GOOGLE_APPLICATION_CREDENTIALS_JSON_B64 env field on the MCP connection

MCP connection setup

Open AnalyticsAgent, find the analytics-mcp MCP connection, and update:

  • GOOGLE_APPLICATION_CREDENTIALS_JSON_B64 — your base64-encoded service account JSON
  • Set your Account ID and Property ID in the system instruction (find them in GA Admin → Property Settings)

Notes

  • The analytics-mcp package is installed automatically by uv run --with
  • Requires Python 3.11+ and uv to be installed on the machine running Heym

How to import this template

  1. 1Click Import → Copy JSON on this page.
  2. 2Open your Heym and navigate to a workflow canvas.
  3. 3PressCmd+V/Ctrl+V— nodes appear instantly.
  4. 4Add your API keys in the node config panels and click Run.
More workflow templates
View all templates