An internal analytics tool for Kellett Communications that connects to Google Analytics 4 and uses Claude to handle the data mechanics — pulling the right metrics, surfacing patterns, and drafting plain-language analysis — so account managers can focus on interpretation and judgment rather than report assembly.








GA4 Intelligence Tool is an internal tool I built for Kellett Communications to reduce the manual work of pulling, filtering, and interpreting GA4 data — surfacing patterns and drafting analysis so account managers can focus on judgment rather than report assembly.
The workflow is two-pass: a first Claude call reviews broad GA4 metrics and surfaces 3–5 focus areas worth investigating. The account manager selects one, which triggers a deeper data pull and an agentic Claude session that investigates, fetches live page content where relevant, and streams a plain-language brief to the UI.
The backend is Slim 4 PHP. It proxies GA4 API calls server-side (using the official google/analytics-data client) and exposes a URL-fetch proxy that Claude can call during analysis to inspect live page content, check redirect chains, or parse sitemaps. The frontend is a single Alpine.js page with no build step.
Anthropic API calls are made directly from the browser with the key served to the JS session at load time and held only in memory — acceptable here because the tool is internal and protected by Google OAuth.
Drill, path analysis, period comparison, and chat turns all give Claude a tools array it can call mid-turn: custom GA4 drill queries with optional filters and comparison periods, inbound/outbound path lookups, and several page-fetch modes (head check, link extraction, body text, redirect chain, sitemap). Claude decides which to call, sequences them, and produces a single coherent response. Prompt caching is applied to system prompts and large data payloads to keep multi-turn sessions fast.