Claude Code for marketing: give your agent a real data backend
Claude Code is already a capable marketing analyst — it just can't see your data. It can reason about ROAS, write SQL, catch a broken campaign in a table of numbers, and draft the report your client expects on Monday. What it lacks is a connection to the places those numbers live: Search Console, GA4, Meta Ads, Google Ads. This guide shows how to close that gap in about five minutes, so "how did paid do last week, and what should I move budget to?" becomes a question you literally type into your terminal.
What Claude Code can already do for marketing
If you've only used Claude Code for shipping features, its marketing instincts are easy to underestimate. Out of the box it can:
- Write and debug real analysis code — SQL, Python, a quick matplotlib chart, a pivot over a messy CSV export.
- Reason across metrics — it knows CTR isn't CVR, that ROAS collapses when attribution windows change, and that a spike in impressions with flat clicks usually means you're ranking for junk.
- Automate the boring loop — weekly summaries, anomaly checks, "did anything break since yesterday" — as long as the data is reachable from the shell.
The catch is the last clause. A coding agent's world is your filesystem and whatever APIs you wire up by hand. Most marketing data sits behind OAuth flows, quota-limited APIs, and export buttons. You can paste CSVs into the chat forever, but every paste is stale by tomorrow, and every source speaks a different dialect — Meta's "purchase value" is not GA4's "conversion value" is not your idea of revenue.
The missing piece: a data backend for your agent
This is the gap TableBI fills. It's a data backend built to be driven by a CLI-native agent like Claude Code, around three moves:
- Pipe — connect each source once (OAuth in the browser). Search Console, GA4, Meta Ads, Google Ads live; anything else as CSV. Data syncs into two altitudes: metrics — one cross-channel table where spend is spend and clicks are clicks regardless of platform — and raw — the lossless per-platform tables underneath.
- Ask — read-only SQL over either altitude, from the terminal. Cross-channel questions hit the unified definitions; forensic questions hit the raw tables.
- Pin — freeze any analysis into a live dashboard with a public read-only URL that keeps refreshing as data syncs. No BI tool, no screenshot ritual.
The part that matters: TableBI hosts no LLM. Inference cost is $0 because your own agent is the brain — the backend just serves trusted, deterministic numbers. Your data never routes through someone else's model.
Set it up in five minutes
Install the CLI, then plant the skill so Claude Code knows the tool exists and when to reach for it:
# install the CLI, then teach your agent to drive it
npm i -g @tablebi/cli
tablebi login
tablebi install
tablebi install drops a skill into ~/.claude/skills — after that, saying "connect my Search Console" or "which campaign is wasting budget?" inside Claude Code is enough; the agent knows the commands. Connecting sources is one OAuth round-trip each:
# live sources: browser opens for OAuth, then data syncs in tablebi connect gsc --site sc-domain:example.com tablebi connect ga4 tablebi connect meta_ads tablebi connect google_ads # one-shot files normalize into the same definitions tablebi connect csv --file tiktok-export.csv --platform tiktok_ads
From then on, every session starts with one rehydration call — definitions, connected sources, data freshness, and the command cheatsheet in a single JSON blob the agent can hold in context:
tablebi context --json
What asking actually looks like
Cross-channel questions run against the unified metrics table, with definition macros (roas, ctr, cpa…) so the agent never re-derives arithmetic wrong:
# ROAS by channel, last 28 days — one query across Meta + Google Ads tablebi ask "SELECT platform, roas(SUM(conversion_value), SUM(cost)) AS roas, SUM(cost) AS spend FROM facts WHERE date >= (SELECT MAX(date) FROM facts) - 28 GROUP BY platform ORDER BY spend DESC"
Forensic questions drop to the raw altitude — the exact rows each platform reported, nothing averaged away:
# which queries lost impressions after the core update? tablebi ask "SELECT query, SUM(impressions) AS imp FROM search_console_raw WHERE date >= (SELECT MAX(date) FROM search_console_raw) - 14 GROUP BY query ORDER BY imp DESC LIMIT 20"
Every answer ships with a trust block: how fresh each source is, and the caveats that keep agents honest — for example, that GSC clicks and GA4 sessions are different populations and shouldn't be expected to match. Your agent reads those caveats and stops confidently comparing apples to oranges.
Pin it: a live dashboard from one command
When an analysis is worth keeping, don't screenshot it — pin it:
tablebi pin --title "Weekly marketing overview" \ --widget "Daily clicks (28d)::line=SELECT date, SUM(clicks) AS clicks FROM facts …" \ --widget "Spend by platform=SELECT platform, SUM(cost) AS spend FROM facts …" ✓ published → https://dk.tablebi.com/d/dsh_… (public, read-only, self-refreshing)
The result is a URL you hand to a client, a co-founder, or your future self. Here's a real one — live Search Console data across a portfolio of sites, pinned exactly this way (this is not a mockup; it refreshes as the sources sync):