Google Analytics in Claude: Query GA4 Without Leaving the Chat
Five GA4 tools for the BlackOps MCP: sessions, top pages, traffic sources, trends, and multi-site comparison

I haven't opened Google Analytics in weeks.
Not because I stopped caring about the numbers. Because the numbers come to me now. In the same chat where I draft the posts.
The analytics tab was the last thing still living outside my Claude conversation. Everything else moved in. I draft tweets here. Write blog posts here. Schedule campaigns here. Build videos here. But when I needed to know which post was getting traction or where the traffic was coming from, I'd still have to alt-tab to GA4, fight the date picker, wait for a report to load, copy a number, and tab back.
Every single time, I'd lose the thread of what I was writing.
So I fixed it. Five new tools on the BlackOps MCP. All hitting the GA4 Data API. All per-site. Encrypted credentials. The loop is closed.
What I can ask now
Real prompts from this week:
"How is benenewton.com doing this month?"
994 sessions, 787 users, 1,033 pageviews. Bounce rate 71%, average session 63 seconds. That's the whole answer. No tab switch.
"What are the top posts over the last 28 days?"
The Claude Code roadmap piece is still pulling. 192 pageviews, 27 seconds average time on page. Everything else is a long tail behind it.
"Where is the traffic coming from?"
Google organic 465, direct 391, blackopscenter.com referral 28, claude.ai referral 24.
Two things jump out. Organic is doing real work. And the BlackOps + claude.ai referrals together are meaningful. Worth knowing. Worth feeding back into what I write next.
"The Claude Code post is dominating. Draft a tweet thread that builds on it."
It drafts the thread. I schedule it for tomorrow. The data and the next move are in the same conversation.
"Save this whole analysis as a Brain note tagged analytics-loop."
Done. A few seconds later it syncs to my Obsidian vault. The decision and the reasoning behind it are filed where I'll find them again.
The technical piece
Five new tools, all prefixed ga4_:
ga4_traffic_overviewfor sessions, users, pageviews, bounce ratega4_top_pagesfor which pages are pulling trafficga4_traffic_sourcesfor where it's coming fromga4_trendfor daily session countsga4_site_comparisonfor looking across multiple properties at once
Credentials live per-site in the BlackOps database. Service account JSON gets pasted into site settings, encrypted on save with AES-256-GCM (same helper I use for extension API tokens). The MCP fetches at request time with a per-domain cache.
One stupid blocker worth naming: GA4's "add user to property" flow has a known UI bug where service account emails come back as "this email doesn't match a Google Account." I lost an hour to that. The workaround is to reuse a service account that's already authorized at the GA4 account level, not the property level. If you're hitting the same wall, that's the move.
The unit tests were green. The build was green. Prod said no. The MCP adapter expected a slightly different response envelope than the new endpoint was returning. Five-line fix. Good reminder that the only test that matters is the one that runs against the real thing.
Why the trend tool matters
Last 14 days on benenewton.com: peaks around 43 to 46 sessions on the good days, valleys at 13 on the slow ones.
Not a clean upward line. Real numbers never look like a marketing chart. They look like a heart rate.
A 994-session month sounds smooth. The trend shows it's a handful of strong days propping up a bunch of quiet ones. That's a different conversation about what to do next.
The loop
Think, publish, measure, iterate. One surface. No friction in the middle.
I didn't build a smarter analytics product. I built fewer tab switches. The loop is what got better.
Setup detail is in the BlackOps docs. Launch announcement and replies are on X.
There's a part two now. I stopped opening the dashboard at all and started just asking the site how it is doing: I Don't Open Analytics Anymore. I Just Ask.
This post came out of a Brain.
Talk through what you already know. BlackOps turns it into a structured knowledge base, then writes and publishes from it, to your own domain, X, LinkedIn, Threads, and your newsletter. No email until you have seen your Brain.
I wrote this post inside BlackOps, my content operating system for thinking, drafting, and refining ideas — with AI assistance.
If you want the behind-the-scenes updates and weekly insights, subscribe to the newsletter.
Related Posts

I Don't Open Analytics Anymore. I Just Ask.
Every BlackOps-hosted site is the same three things: posts, pages, and newsletter signups. So you can just ask your site how it is doing. The interesting part is that everyone asks it something different.

BlackOps Kept Giving Me the Same SEO Advice Every Week. So I Gave It a Memory.
BlackOps kept handing me the same SEO advice every week, so I built per-site memory into its GA4 and Search Console tools. Here is how it works.

I Spent Years Automating My Obsidian Daily Note. Now It Files Itself.
For years I fed my Obsidian daily note by hand. Now an agent files my captures overnight, tells my thoughts from my tasks, and I wake up to a clear picture of what's next.