All how-tos
10 min
Beginner
Claude Code
Claude Cowork
Managed Agents
Gentic Ingest
Analytics
MCP

How to connect Claude Code to your website analytics

Give your AI agent read-access to your live website analytics in about 10 minutes — drop a tiny snippet, connect the Analytics MCP server, and start surfacing the things you'd never spot from a dashboard. Includes setup for Claude Code, Claude Cowork, and Claude Managed Agents.

Published May 25, 2026

Your website has problems you don't know about — pages that slowed down after the last deploy, signup forms that started losing visitors on mobile, CTAs that suddenly nobody clicks. The data is there, but nobody opens the dashboard often enough to catch it.

This guide walks through giving an AI agent — Claude Code, Claude Cowork, or Claude Managed Agents — read-access to your live site analytics through the Gentic Analytics MCP server. Gentic Ingest events, PostHog sessions, and Northbeam attribution, all queryable in plain English. About 10 minutes, no infrastructure to manage, free to start.

Your site
Ingest Snippet
Gentic Ingest
Event lakehouse
Your agent
via Analytics MCP
Your insights
In natural language
1

Create a free Gentic account

Head to gentic.co/sign-up and create an account with your work email. The free tier covers your first site, 100K events/month, and an API key that unlocks all of Gentic's MCP servers — including Analytics.

Already have an account?

Skip to step 2 — sign in and head to Integrations → Gentic Ingest.

2

Add your site and reveal the keys

From your dashboard, open Integrations → Gentic Ingest and click Add domain. Enter the host you want to track (e.g. example.com). Gentic provisions two keys for that domain:

  • A write key (wk_...) — the value the browser snippet sends events with.
  • A read key (rk_...) — for server-side analytics queries.

Click Reveal once and copy both keys somewhere safe. The Gentic dashboard returns them in a single round-trip so the snippet appears the moment you reveal.

dashboard.gentic.co · Integrations → Gentic Ingest
example.com

site_8f2a1c…

Write key — for the snippet
wk_8f2a1c4e9b3d7a52c0f6e8d1b4a9c3e7
Read key — for server-side analytics queries
rk_5c1b2e8d4f6a9c3e7b0d2a5c8f1e4b7d
3

Drop the snippet on your site

Copy the snippet from your dashboard — Gentic puts it right under the keys with a Copy button — and paste it inside your site's <head>. It's under 2KB gzipped, loads async, and doesn't block your page.

index.html
<script async src="https://ingest.gentic.co/gentic-ingest.js" data-site-key="YOUR_WRITE_KEY"></script>

Replace YOUR_WRITE_KEY with the wk_... value from step 2. Once it's live, open your site, hit a few pages, then come back to the dashboard — the snippet starts streaming events to your lakehouse the moment a page with it loads.

Using Next.js, Webflow, or Shopify?

Drop the snippet in your root layout's <head> (Next.js), or paste it into the <head> custom-code slot (Webflow, Shopify, Framer). Position doesn't matter — keep it async and you won't slow your page.

4

Get your Gentic API key

Your Gentic API key is what an agent uses to authenticate to the Analytics MCP server. In the dashboard, open API Keys, click Create key, and copy the value. It's a Bearer token that covers every Gentic MCP server you connect to — Analytics, Data, Research, all of them — under the same organization.

API keys are organization-scoped

If you're on a team plan, the key inherits your active organization's billing and integrations. Switching org in the dashboard issues you a new key for that org.

5

Connect via Claude Code (CLI)

If you're driving Claude from the terminal, register the MCP server with one command. Replace YOUR_GENTIC_API_KEY with the value from step 4.

Terminal
claude mcp add gentic-analytics --transport http https://mcp.gentic.co/analytics --header "Authorization: Bearer YOUR_GENTIC_API_KEY"

Verify it landed:

Terminal
claude mcp list

You should see gentic-analytics in the output with its 33 tools — 23 prefixed gentic_ingest_* (your site data), plus PostHog and Northbeam tools that light up the moment you connect those data sources in your dashboard.

6

Connect via Claude Cowork (or claude.ai)

If you're using Claude on the web or in the desktop/Cowork app, add the Analytics MCP server as a connector. The connector flow authenticates via OAuth, so no API key handling required.

  1. Open Claude's Settings → Connectors (or the equivalent in your workspace).
  2. Click Add custom connector.
  3. Paste the server URL: https://mcp.gentic.co/analytics
  4. Approve the OAuth prompt. Claude will issue itself a scoped token tied to your Gentic account.

Already signed in to Gentic in the same browser?

The OAuth handshake reuses your existing Gentic session — no second login. You only have to authorize the connector once per workspace.

7

Connect via Claude Managed Agents

Claude Managed Agents (currently beta, header managed-agents-2026-04-01) has three pieces that need to be in your workspace before you can create the agent — the skill, the credential vault, and the agent itself, which references both. Do them in this order.

7a. Upload the analytics skill to your workspace

In the Claude Console, open Skills and create a new custom skill from the Gentic analytics .skill bundle. The Console returns a skill_id (looks like skill_abc123…) once the upload finishes — copy it for the agent definition below.

7b. Register your Gentic API key in a Credential Vault

Managed Agents matches credentials to MCP servers by URL at session runtime. Open Credential Vaults in the Console, create a vault (e.g. "Gentic"), and add a credential of type static_bearer:

  • mcp_server_url: https://mcp.gentic.co/analytics
  • token: your Gentic API key from step 4

The URL must match the MCP server URL on the agent exactly, otherwise the session connects unauthenticated. Save the vault_id (vlt_01…) — sessions reference it.

One credential per server URL per vault

If you also want Claude to read your Gentic Data or Brain MCP servers from the same agent, add a separate credential per mcp_server_url to the same vault — each binds to one server.

7c. Create the agent referencing both

When you create the agent, declare the MCP server, wire it into the tools array, and attach the custom skill. The vault is not referenced here — it gets attached at session time.

Agent definition
{
  "name": "Site Analytics",
  "model": "claude-opus-4-7",
  "mcp_servers": [
    {
      "type": "url",
      "name": "gentic-analytics",
      "url": "https://mcp.gentic.co/analytics"
    }
  ],
  "tools": [
    {
      "type": "mcp_toolset",
      "mcp_server_name": "gentic-analytics"
    }
  ],
  "skills": [
    {
      "type": "custom",
      "skill_id": "skill_abc123",
      "version": "latest"
    }
  ]
}

7d. Start a session with the vault attached

At session creation, pass the vault you created in 7b via vault_ids. Anthropic matches the credential's mcp_server_url to the agent's MCP server URL and injects the bearer token — you'll see "Connected via MCP Vaults" in the Console once it lands.

Session creation
{
  "agent": "agt_…",
  "environment_id": "env_…",
  "vault_ids": [
    "vlt_01…"
  ]
}

Connection failures don't block the session

If the credential URL doesn't match or the server is unreachable, Anthropic emits a session.error event with the MCP server name and retries on the next idle→running transition. The session itself still starts.

8

Drop in the analytics-report skill

The MCP server gives Claude the tools. The skill file teaches Claude how to use them well — site resolution, current-vs-previous period comparisons, when to fall back to constrained SQL.

Grab the skill from gentic.co/ingest — drag the .skill bundle into Claude Code as a Skill, or paste the raw SKILL.md as a system prompt anywhere else:

Claude Managed Agents users

You already got this in step 7 — the analytics .skill bundle from gentic.co/analytics/gentic-analytics.skill includes the report workflow alongside the MCP wiring.

9

Ask Claude about your site

Open your client and ask in plain English. The skill tells Claude to resolve the site first, then call the right gentic_ingest_* tools and respond with a structured report.

Claude Code · claude
You

Generate today's analytics report for example.com.

AI

Daily report — example.com · May 25

  • Visitors: 1,847 (+12% dod)
  • Bounce rate: 41% (was 38%) — uptick on /pricing
  • Top entry: /blog/why-headless-analytics from producthunt.com
  • LCP regression: /dashboard hit 4.1s p75 (was 2.3s)
  • Form submits: /signup down 22%

Want the rage-click breakdown for /signup? Just ask.

From here you can:

  • Ask follow-ups in the same conversation — Claude already has the site resolved.
  • Schedule a recurring Claude Code task that runs the same prompt daily and posts to Slack.
  • Wire the MCP endpoint into n8n, ChatGPT, or any other MCP-compatible agent and get the same surface there.

Want this fully automated?

Connect Mother — Gentic's hosted agent — and she'll run the daily report on a schedule and Slack you when something needs attention. See gentic.co/ingest for the proactive-monitoring setup.

Everything your agent can ask about

Six categories of measurements across the 23 Gentic Ingest tools. Once Claude is connected, any of these is reachable in plain English — no SQL unless your agent decides it wants to compose one.

Traffic & audience

Who showed up, where they came from, where they landed first.

  • Unique visitors per day
  • Sessions per day with bounce + duration
  • Top referring pages (document.referrer)
  • Top entry pages with bounce rate per page
  • Top exit pages
  • Mobile vs desktop pageview split

Engagement & retention

How long visitors stay, how far they scroll, whether they actually engaged.

  • Average wallclock dwell time per URL
  • Average active-engagement time per URL
  • Average max scroll depth (0–100) per URL
  • Bounce rate site-wide
  • Sessions summary: avg pages/session, median duration

Performance (Core Web Vitals)

What's fast, what's slow, what regressed after the last deploy.

  • LCP average and p75 per URL
  • CLS average and p75 per URL
  • Pass/fail vs Google Core Web Vitals thresholds

UX friction & heatmaps

Where users hit dead-ends, rage-click, or behave like the UI is broken.

  • Top rage-click incidents (3+ clicks within 1500ms on the same element)
  • Aggregate click counts by tag + class-chain
  • 100×100 viewport-normalized click heatmap per URL
  • Most-clicked outbound destinations

Conversion & forms

Whether visitors finished what they started, and where they peeled off.

  • Form submit counts per (url, form_id) with unique-visitor counts
  • Ecommerce funnel completion: pageview → cart → checkout → purchase
  • Checkout-stage drop-off with step-to-step conversion %

Revenue (ecommerce)

What's selling, when, and how much — hourly granularity.

  • Hourly purchase counts
  • Summed revenue per hour bucket

Anything else? Constrained SQL.

When none of the above cover the question, your agent introspects the schema via gentic_ingest_describe_events (free) and runs an ad-hoc SELECT via gentic_ingest_execute_query (25¢ / call). Read-only, time-window-bounded.

What's next

  • Connect PostHog or Northbeam for richer behavior data and ad attribution. Both light up additional tools on the same MCP endpoint — your agent picks them up automatically.
  • Read the skill file to understand exactly what Claude is doing under the hood — handy when you want to extend it for custom reports.
  • Browse the Analytics MCP tools for the full surface — 33 typed tools your agent can call without writing a line of SQL.
gentic
TermsPrivacy

© 2026 gentic. All rights reserved.