Skip to content

Connect BigQuery to Claude Code

  • Are all events coming through?

Have 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.

MCPhttps://mcp.lemonado.io/mcp

Why 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. 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. 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.

    text
    https://mcp.lemonado.io/mcp
  3. 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. 4

    Sign in

    Start Claude Code with claude and run /mcp. Choose Lemonado and finish the sign-in in your browser.

    bash
    claude
    /mcp
  5. 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.

Claude Code logoClaude Code

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

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.

For agents · markdown
# 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
FAQ

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.

See plans and pricing

Still have a question?

Shoot us an email at hello@lemonado.io.

Try for free

Stop fighting with data. Start feeding your AI.

Connect your data to AI and free your team from reporting and busywork.

Try Lemonado free