Build a Google Analytics traffic dashboard with Claude
Connect the official Google Analytics MCP server to Claude, ask for a traffic and acquisition dashboard from your live GA4 numbers, and publish it to a link your team comments on directly — no BI tool, no screenshots pasted into Slack.
drafty.im/canvas/… link. Your team clicks the exact chart or number they want changed and leaves a note. Claude reads the comments and ships a revised version to the same URL.This is an end-to-end example: connect a data source over MCP, generate a dashboard from live numbers, and close the review loop on one link. Total time, start to shared link, is under fifteen minutes. The same shape works for any of the other examples — only the connection step changes.
Here's the finished dashboard, published to a canvas — click any tile or number to leave a comment, exactly as your team would:
The three moving parts
- The Google Analytics MCP server gives Claude read access to your GA4 properties — sessions, users, channels, pages, events — through a controlled set of report tools. You authorize it with a read-only scope.
- Claude pulls the numbers and writes a single self-contained HTML dashboard. You iterate on it in the artifact panel until it's right.
- Drafty turns that HTML into a stable link your team reviews. Comments pin to the exact element; Claude ships the fix to the same URL.
The generation step is fast now. The part this example is really about is the third one — getting the dashboard in front of people without losing their feedback to a screenshot circled in Preview.
Step 1 — Connect the Google Analytics MCP server
Google maintains an official Analytics MCP server (analytics-mcp) that runs locally and talks to the GA4 Data and Admin APIs. It authenticates over Application Default Credentials, so you authorize once with a read-only scope rather than pasting a long-lived key into a config file.
First, authorize with the Analytics read-only scope using the gcloud CLI:
In Claude Code, add the server (it runs via pipx, so no separate install step):
Replace YOUR_PROJECT_ID with your Google Cloud project. Then run /mcp inside Claude Code to confirm the server connected.
In Claude Desktop: open Settings → Developer → Edit Config, and add an analytics-mcp entry to mcpServers with command pipx, args ["run", "analytics-mcp"], and GOOGLE_CLOUD_PROJECT in the env object — then restart Claude Desktop.
analytics.readonly scope and nothing more — a reporting dashboard never needs write access. The credentials live in your local ADC file; don't paste them into a config file or commit them. If you run this as an unattended agent, use a service account with the read-only Analytics scope, not your full account.Step 2 — Pull the numbers
Ask Claude in plain language. It uses the MCP server's read tools (run_report, run_realtime_report, get_account_summaries) to fetch real data:
Claude calls the GA4 Data API, returns the figures, and you sanity-check them against the Google Analytics dashboard before going further. This is the moment to catch a wrong assumption — the wrong property, a date range off by a day, a channel grouping you didn't expect — while it's cheap.
Step 3 — Build the dashboard
Once the numbers look right, ask for the artifact:
Claude renders it live in the artifact panel. Iterate in place — you're not regenerating from scratch:
- "Make sessions the biggest number and show the trend sparkline under it."
- "Sort the channel chart by sessions, descending."
- "Add a new-vs-returning split to the users tile."
Step 4 — Publish to Drafty for review
A Claude artifact link is a preview, not a stable URL — iterate the artifact and the link you already sent now shows the old version. Ask Claude to publish it to a Drafty canvas instead, so the link you share always stays current:
Claude pushes the dashboard and hands back a drafty.im/canvas/… link that renders on any device. Send it — your team opens it in a browser, no login and no Claude account needed.
Step 5 — The review loop
This is the part that's not obvious until you've done it once.
A reviewer clicks the specific tile, chart, or number they want changed and leaves a pinned comment — "this organic figure looks low, are we counting Google Discover as referral?" The comment is anchored to that element, not floating in a Slack thread. Claude reads the comments through the CLI, reruns the relevant GA4 query if needed, and pushes a revised dashboard to the same URL. The reviewer refreshes and sees the change; the thread stays attached to the element.
The mechanic matters because of what it removes. A Slack message about a chart produces "the number on the left looks wrong." A pinned comment on the actual tile produces "this — split paid out of the organic bucket." One of those produces a correct revision; the other produces a guess.
Keeping it fresh
An MCP-generated dashboard is a snapshot — it holds the numbers Claude pulled when it built it; it doesn't re-query Google Analytics when someone opens the link. For a weekly review or a board-ready snapshot, that's fine.
To make it a live canvas that always shows today's figures, copy this prompt — Claude sets up the refresh for you and schedules it to run on its own:
The link stays stable while the content updates underneath it — see keeping a canvas updated automatically.
What to watch for
- Read-only, always. A traffic dashboard needs read access and nothing more. Authorize with the
analytics.readonlyscope and don't add write scopes. - Check the figures before you share. The MCP returns exactly what you ask for — if your query pulls the wrong property, a mismatched date range, or a channel grouping you didn't expect, the dashboard will confidently show the wrong number. Reconcile against the Google Analytics dashboard once.
- The link is the deliverable, not the artifact. Share the Drafty URL, not the Claude artifact preview — that's the one you can update in place.
Google Analytics dashboard with Claude — FAQ
- Do I need to paste an API key anywhere?
- No. The official Google Analytics MCP server authenticates over Application Default Credentials — you run a one-time gcloud login with the analytics.readonly scope and the credentials live in your local ADC file. Nothing gets pasted into a config or committed. For an unattended agent, use a service account scoped to read-only Analytics access.
- Is the dashboard live or a snapshot?
- A snapshot. It contains the numbers Claude pulled when it built the file; it does not re-query GA4 when someone opens the link. To refresh it, ask Claude to repull and re-push to the same URL — or put that on a daily schedule so the stable link always shows current numbers.
- Can my team comment without a Google Analytics or Claude account?
- Yes. The dashboard is published to a Drafty canvas link that renders in any browser. Reviewers click the exact element they want changed and leave a pinned comment with no login required. Only the person connecting Google Analytics needs access to the property.
- Is it safe to give Claude access to my Google Analytics data?
- Authorize with the analytics.readonly scope and a traffic dashboard never needs more than that. The MCP server runs locally and every tool call is a read against the GA4 Data and Admin APIs; in Claude you approve the actions. Don't grant write scopes for a read-only reporting task.
- How is this different from a Looker Studio or GA4 Explorations dashboard?
- Looker Studio and GA4 Explorations query live data against a report you maintain — the right choice for governed, always-on reporting. This approach is for a fast, shareable snapshot you can spin up in minutes and iterate by talking to Claude, then collect feedback on inline. Different jobs: one is a standing system, the other is a quick reviewable deliverable.