Connect
BigQuery to
Claude Code
- Are all events coming through?
https://mcp.lemonado.io/mcpHave Claude Code write and save BigQuery SQL for your GA4 export, and check the tracking code that feeds it. Lemonado connects them in about 1 minute, no API keys needed.
https://mcp.lemonado.io/mcpWhy connect BigQuery to Claude Code?
GA4's export schema is nested and awkward to query, and most broken metrics trace back to the tracking code. Claude Code reads that code in your repo, and through Lemonado it can run queries against the export to see what actually arrives, then save the queries as files your team can rerun.
All your BigQuery data
Datasets and tables your account can read, ready to ask about.
Always today's numbers
Google Ads and Search Console bulk exports, if you run them, synced from BigQuery automatically, so answers use today's numbers.
Connect all your tools
Questions like "What did paid sessions earn?" use BigQuery and GA4, Snowflake at once.
How to connect BigQuery to Claude Code
Before you start
- A Google BigQuery account you can sign in to
- Claude Code installed
- A Lemonado account (the free trial works)
- 1
Connect Google BigQuery in Lemonado
In Lemonado, open Connectors, find Google BigQuery and sign in. Sign in with a Google account that can read the dataset holding your GA4 export, and pick that project. The BigQuery Data Viewer and Job User roles are enough.
- 2
Turn on external access
In the company's settings, open External tools, turn the connection on, choose which sources it can reach and copy the server URL.
texthttps://mcp.lemonado.io/mcp - 3
Add the server
With Claude Code installed, run one of these in your terminal. Most people want the first: it adds Lemonado to every project.
bash# every project (recommended) claude mcp add --scope user --transport http lemonado https://mcp.lemonado.io/mcp # this project only claude mcp add --transport http lemonado https://mcp.lemonado.io/mcp - 4
Sign in
Start Claude Code with claude and run /mcp. Choose Lemonado and finish the sign-in in your browser.
bashclaude /mcp - 5
Ask Claude Code about BigQuery
Ask a question about the accounts your connection can reach. Claude Code can also write the numbers into a file or a script for you. Try "List every event our code sends to GA4 (search the repo for gtag and dataLayer.push) and check which ones appear in the BigQuery export for the last 7 days." Or ask: "Flatten the events table" or "Rerun it every Monday"
Good to know
- The command uses Claude Code's default local scope. Use --scope user to share the server across projects.
What can Claude Code do with BigQuery?
Claude Code queries your BigQuery data while it works in your repo: it saves data as files, checks tracking against code and runs headless with claude -p.
List every event our code sends to GA4 (search the repo for gtag and dataLayer.push) and check which ones appear in the BigQuery export for the last 7 days.
The code sends 24 events. 21 appear in the export. view_promotion, share and filter_used never arrive, because they're pushed before the consent update fires.
Source: BigQuery + your code
Write a view in sql/ga4_purchases_flat.sql that unnests purchase events into one row per item with price, quantity and campaign.
Saved and tested on yesterday's table: 1,214 item rows from 402 purchases. Campaign comes from collected_traffic_source, which is filled for 92% of them.
Source: BigQuery + your code
Create a prompt file for claude -p that writes reports/weekly-ga4.md from the export: sessions, purchases and revenue by default channel group.
Saved prompts/weekly-ga4.md. Run it with claude -p on a schedule and the report rewrites itself from the newest export tables.
Source: BigQuery + your code
Compare item_id values in the GA4 export with the SKUs in our product feed file. Which products don't match?
38 products send their variant ID instead of the SKU. All of them come from the quick-add button in components/QuickAdd.tsx.
Source: BigQuery + your code
Count purchase events per day in our BigQuery GA4 export for the last 30 days, and flag days that look short.
October 14 has 61 purchases against a usual 180 to 210. The export job finished, but consent mode dropped most events after a banner update that day.
Source: Google BigQuery
Join GA4 purchase revenue from BigQuery with Google Ads cost by campaign for last month.
Brand search returned $11.80 per dollar, Performance Max $3.10. Two PMax asset groups spent $4,200 with no GA4 purchases at all.
Source: BigQuery + Google Ads
Connect BigQuery to another AI app.
Claude
Connect BigQuery to Claude
ChatGPT
Connect BigQuery to ChatGPT
Cursor
Connect BigQuery to Cursor
VS Code (GitHub Copilot)
Connect BigQuery to VS Code (GitHub Copilot)
Codex
Connect BigQuery to Codex
Perplexity
Connect BigQuery to Perplexity
Google Antigravity
Connect BigQuery to Google Antigravity
Windsurf (Devin Desktop)
Connect BigQuery to Windsurf (Devin Desktop)
Zed
Connect BigQuery to Zed
n8n
Connect BigQuery to n8n
Other integrations for Claude Code
All Claude Code integrations- Google Analytics in Claude CodeAsk Claude, ChatGPT or Cursor about GA4 traffic, conversions and funnels, next to your ad spend.
- Snowflake in Claude CodeAsk Claude, ChatGPT or Cursor about the numbers in your Snowflake warehouse, with live ad spend next to them.
- Google Ads in Claude CodeAsk Claude, ChatGPT or Cursor about your Google Ads campaigns, search terms and spend.
- Google Search Console in Claude CodeAsk Claude, ChatGPT or Cursor about your search queries, rankings and lost clicks.
- Google Tag Manager in Claude CodeAsk Claude, ChatGPT or Cursor what's in your GTM container, and what changed when tracking broke.
- Pipedrive in Claude CodeAsk Claude, ChatGPT or Cursor about your Pipedrive deals, and which ads bring the ones that close.
Reading this as an AI agent?
Everything an agent needs to set this up, in plain text. Paste this page's link into Claude Code and ask it to connect you, or copy the block.
# Connect Google BigQuery to Claude Code (Lemonado MCP) - Server URL: https://mcp.lemonado.io/mcp - Transport: Streamable HTTP - Auth: OAuth; the user signs in to Lemonado in the browser. No API keys. - In Lemonado: connect the Google Cloud project. Sign in with a Google account that can read the dataset holding your GA4 export, and pick that project. The BigQuery Data Viewer and Job User roles are enough. - In Claude Code: Terminal: claude mcp add ```bash # every project (recommended) claude mcp add --scope user --transport http lemonado https://mcp.lemonado.io/mcp # this project only claude mcp add --transport http lemonado https://mcp.lemonado.io/mcp ``` If you are Claude Code, run the setup yourself: Add the Lemonado MCP server for all my projects by running: claude mcp add --scope user --transport http lemonado https://mcp.lemonado.io/mcp Then tell me to run /mcp and sign in to Lemonado. Once I've signed in, list the Google BigQuery accounts Lemonado can reach. First question to try: "List every event our code sends to GA4 (search the repo for gtag and dataLayer.push) and check which ones appear in the BigQuery export for the last 7 days." More: https://lemonado.io/integrations/bigquery · https://lemonado.io/llms.txt
Frequently Asked Questions
You can. MCP Toolbox for Databases is a local server you configure with your own tools and credentials, and Google also runs a hosted BigQuery server. Lemonado is one URL with a Google sign-in, and adds Google Ads, Meta and Search Console on the same connection.
Yes. Google's BigQuery MCP server is hosted, so Claude Code can use it too. It covers Google BigQuery only. Lemonado covers Google BigQuery plus your ad platforms, GA4 and the rest of your stack in one connection, so Claude Code can answer questions across them.
Run claude mcp list to see whether lemonado is connected. If it needs authentication, run /mcp inside Claude Code and sign in again. In Lemonado, check that Google BigQuery is connected and External tools is on for the company. If yesterday's GA4 data is missing, the daily export may not have landed yet. GA4 writes the events_ table for a day several hours after it ends.
Yes, if both are connected in Lemonado. One connection reaches every source you allow, so you can ask things like "Join GA4 purchase revenue from BigQuery with Google Ads cost by campaign for last month."
MCP is included in Lemonado's paid plans and in the free trial, so you can try it before you pay.
Still have a question?
Shoot us an email at hello@lemonado.io.
Try for freeStop fighting with data. Start feeding your AI.
Connect your data to AI and free your team from reporting and busywork.
Try Lemonado free