How to build Google Analytics 4 dashboards in Metabase
Google Analytics 4 is Google's web and app analytics platform, tracking events, sessions, conversions, and acquisition channels. Metabase is where you turn that marketing data into shared, trustworthy dashboards. This guide covers two complementary paths: a lightweight MCP + CLI route that pulls live data with the Google Analytics MCP server and loads a CSV into Metabase with the Metabase CLI, and a durable pipeline route that syncs Google Analytics 4 daily stats into a database so you can build dashboards anyone can read.
How do you connect Google Analytics 4 to Metabase?
Most teams combine both routes: use MCP and CLI uploads for a fast first pass, then move recurring marketing reporting to a warehouse-backed model.
Live data in, quick analysis out
Pair the Google Analytics MCP server with the Metabase CLI. Use MCP for live lookups, write a scoped result to CSV, then load it into Metabase as a ready-to-query table and model.
- Quick lookups such as "show me sessions and conversions by channel"
- Loading a Google Analytics 4 export into Metabase in seconds
- Spot-checks and one-off analyses without a warehouse
- Great for exploration, not governed recurring reporting
- Use read-only/scoped credentials wherever the MCP server supports them
- CSV uploads are snapshots — refresh or move to the pipeline for history
Durable dashboards with history
Sync Google Analytics 4 daily stats and entities into a database or warehouse with a connector, custom pipeline, or API, then point Metabase at it.
- Google Analytics 4 reporting that marketing leaders depend on
- Joining Google Analytics 4 data with CRM, revenue, or product data
- Long-run trends for sessions and conversions by channel and landing-page conversion rates
- You own the refresh schedule and the rollup grain
- Sync daily aggregates and entities — not raw event streams
- Metric definitions must be consistent across channels and teams
What can you analyze from Google Analytics 4 data in Metabase?
- Sessions and conversions by channel — built from session and event rollups and the related events, sessions, users data your sync exposes.
- Landing-page conversion rates — built from session and event rollups and the related events, sessions, users data your sync exposes.
- Campaign performance from UTM data — built from session and event rollups and the related events, sessions, users data your sync exposes.
- Ecommerce revenue by source — built from session and event rollups and the related events, sessions, users data your sync exposes.
- New vs. returning user trends — built from session and event rollups and the related events, sessions, users data your sync exposes.
Which Google Analytics 4 dashboards should you build in Metabase?
Traffic overview
Who arrives, from where, and what they do.
- Sessions by channel by week (stacked area)
- Engaged sessions and engagement rate (line)
- Top landing pages by sessions (table)
- New vs. returning users (combo)
Organic performance
Search visibility and what it earns.
- Organic clicks and impressions by week (combo)
- Top queries by clicks and position (table)
- Pages gaining or losing clicks (table)
- Branded vs. non-branded clicks (stacked bar)
Conversion funnel
Where visits become signups or purchases.
- Conversion rate by channel (bar)
- Landing-page conversion rates (table)
- Key events by week (line)
- Funnel step drop-off (funnel)
Acquisition mix
The paid vs. organic balance over time.
- Sessions by paid vs. organic (stacked area)
- Conversions by acquisition type (bar)
- Cost per session for paid channels (line)
- Channel mix shift, trailing 12 months (area)
How do you use the Google Analytics MCP server with the Metabase CLI?
Pair the Google Analytics MCP server with the Metabase CLI for fast, hands-on analysis. MCP is useful for scoped lookups and summarized exports; the Metabase CLI's upload command loads CSV data into Metabase and creates a ready-to-query table and model.
Example workflow
- Ask the MCP server for a daily summary of session and event rollups for the last 90 days.
- Export the result as CSV, keeping stable IDs, channels, campaigns, and dates.
- Run
mb upload csvto load it into Metabase as a table and model, then build questions and dashboards on top.
Be honest about the limits
- MCP lookups are excellent for exploration, not scheduled reporting.
- A CSV upload is a snapshot; refresh it with
mb upload replaceor move to the pipeline for real history. - Daily rollups by channel and page are required for traffic and conversion trends.
mb upload csvneeds an uploads database configured under Admin → Settings → Uploads.
How do you set up Google Analytics 4 MCP and the Metabase CLI?
Google Analytics MCP serverofficial
- Transport
- Local server (Python) over stdio
- Auth
- Application Default Credentials with the analytics.readonly scope
- Best for
- Live scoped lookup and export
Metabase CLIofficial
- Install
npm install -g @metabase/cli- Auth
mb auth login- Load data
mb upload csv --file data.csv- Requires
- An uploads database (Admin → Settings → Uploads)
{
"mcpServers": {
"analytics-mcp": {
"command": "pipx",
"args": ["run", "analytics-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/credentials.json",
"GOOGLE_PROJECT_ID": "your-project-id"
}
}
}
}Google's server is read-only and labeled experimental. Naming trap: the official PyPI package is analytics-mcp — the similarly named google-analytics-mcp on PyPI is a community project.
# Install the Metabase CLI
npm install -g @metabase/cli
# Log in (opens your browser; requires Metabase v62+)
mb auth login --url https://your-metabase.example.com
# Load a session-and-event-rollups export — creates a table AND a model
mb upload csv --file google-analytics-session-and-event-rollups.csv --collection root
# Refresh that same table later from a new export
mb upload replace <table-id> --file google-analytics-session-and-event-rollups.csvCan you generate a Google Analytics 4 dashboard with AI?
Yes. Use the prompt below with any assistant that can run the Google Analytics MCP server and the Metabase CLI. It works end to end: if Google Analytics 4 tables already exist in Metabase it analyzes those; otherwise it pulls scoped, summarized data over MCP, loads it with mb upload csv, then builds the dashboard and caveats any metric that needs missing history.
Create a polished Metabase dashboard for Google Analytics 4 web analytics analytics.
Work end to end: get the data into Metabase if it isn't there yet, then build.
Goal: Help marketing and growth leaders understand traffic by channel, landing-page conversion, organic search performance, and the paid vs. organic mix from Google Analytics 4 data.
Step 1 — Find or load the data:
- First, check what already exists in Metabase (search for google-analytics tables and
models). If durable Google Analytics 4 data is already present — synced from a warehouse
or uploaded earlier — use it and skip to Step 2.
- If nothing is there, pull a scoped, summarized export with the Google Analytics MCP server:
session and event rollups, plus events, sessions, users.
Prefer daily aggregates over raw events. Write each result to a CSV,
then load it with the Metabase CLI — run "mb upload csv --file <export>.csv" so
each upload creates a table and a ready-to-query model. Use "mb upload replace
<table-id> --file <export>.csv" to refresh an existing table instead of creating
duplicates.
Step 2 — Inspect before querying:
Do not assume exact table or column names. Inspect available fields, channels,
campaigns, dates, and whether daily history exists before creating trend or
pacing cards.
Important:
- Build on whatever data is present; don't claim Metabase connects natively to
Google Analytics 4 — it reads a database or CLI-uploaded tables.
- Never try to load raw event or click streams into Metabase; use daily
aggregates, campaign-grain stats, and entity tables.
- Only compute rates (CTR, conversion rate, ROAS, CAC) when both numerator and
denominator exist — and state the attribution model when reporting conversions.
- Exclude test campaigns and internal traffic from headline cards, and keep
currency consistent when spend spans accounts.
- A single CSV is a point-in-time snapshot: only build trend cards if there is a
usable date column or multiple periods have been uploaded.
Dashboard title: Google Analytics 4 Web Analytics Overview
Sections:
1. Executive summary: Sessions last 30 days; Conversion rate; Key events;
Organic clicks; Paid vs. organic share.
2. Traffic: Sessions by channel by week; top landing pages; engagement rate.
3. Conversion: Conversion rate by channel; landing-page conversion table.
4. Organic: Clicks and impressions by week; top queries; branded vs. non-branded.
5. Mix: Paid vs. organic sessions and conversions over time.
Filters: Date range, Channel, Campaign, Country, Device, Segment.
Output: Build the dashboard if you have permission; otherwise provide the exact
questions, SQL, model definitions, and layout. Include caveats for any metric
that cannot be calculated from the available data.How do you sync Google Analytics 4 data into a database or warehouse?
For dashboards that need history and reliability, land Google Analytics 4 daily stats and entities in a database first, then connect Metabase to that database.
Connector options
- Managed ETL — use a connector when one covers the objects you need.
- Custom pipeline — use the GA4 Data API for control over grain, fields, and refresh cadence.
- MCP + CSV — use this for quick exploration and one-off slices.
For durable analysis, prefer GA4's native BigQuery export (free daily export of raw, unsampled events) and point Metabase at BigQuery. Report-shaped syncs work too: the dlt google_analytics verified source, the Airbyte GA4 source, or Fivetran's GA4 and GA4 Export connectors.
Notes
- Decide the rollup grain first (daily per campaign/channel is the workhorse) — it drives warehouse cost and every trend card.
- Land raw entity tables first, then build clean Metabase models on top.
- Normalize channel, source, medium, campaign, landing-page, date, sessions, and conversions fields.
How should you model Google Analytics 4 data in Metabase?
Core tables
| Table | Grain | Key columns |
|---|---|---|
ga4_sessions_daily | one row per channel per landing page per day | session_date, channel_group, source, medium, campaign, landing_page, sessions, engaged_sessions, key_events, revenue |
ga4_events | one row per event (BigQuery export) | event_date, event_name, user_pseudo_id, ga_session_id, event_params, device, geo |
ga4_key_events_daily | one row per key event per channel per day | event_date, event_name, channel_group, count, value |
Modeling advice
- Build a clean
traffic_rollupsmodel with common columns across tools, so multi-channel dashboards don't fork definitions. - Separate entity tables (campaigns, audiences, pages) from daily time-series rollups.
- Exclude test campaigns and internal traffic from headline metrics; keep channel and campaign as explicit columns.
- Use stable IDs for campaign, channel, and user joins; display names change.
Which Google Analytics 4 metrics should you track in Metabase?
| Metric | Definition | Notes |
|---|---|---|
| Organic clicks & impressions | Search-driven visits and visibility from Search Console data. | Sync early — the API window is 16 months. |
| Landing-page conversion rate | Conversions divided by sessions per landing page. | Set a minimum session threshold to avoid noise. |
| Click-through rate | Clicks divided by impressions in search results. | Read it against position — CTR falls off a cliff below the fold. |
| Conversion rate | Conversions divided by sessions or visitors per period. | Pin the denominator: sessions, users, or visits. |
What SQL powers Google Analytics 4 dashboards in Metabase?
These assume a cleaned analytical model in a warehouse (PostgreSQL dialect). Adjust table and column names to match your pipeline.
The acquisition overview from traffic rollups.
SELECT
channel_group,
date_trunc('week', session_date) AS week,
SUM(sessions) AS sessions,
SUM(key_events) AS conversions,
ROUND(100.0 * SUM(key_events) / NULLIF(SUM(sessions), 0), 2)
AS conversion_rate_pct
FROM traffic_rollups
GROUP BY 1, 2
ORDER BY 2, sessions DESC;Which pages earn their traffic.
SELECT
landing_page,
SUM(sessions) AS sessions,
SUM(key_events) AS conversions,
ROUND(100.0 * SUM(key_events) / NULLIF(SUM(sessions), 0), 2)
AS conversion_rate_pct
FROM traffic_rollups
WHERE session_date >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY landing_page
HAVING SUM(sessions) >= 100
ORDER BY conversions DESC
LIMIT 20;Search performance from Search Console rows.
SELECT
date_trunc('week', stat_date) AS week,
SUM(clicks) AS clicks,
SUM(impressions) AS impressions,
ROUND(100.0 * SUM(clicks) / NULLIF(SUM(impressions), 0), 2) AS ctr_pct,
ROUND(AVG(position), 1) AS avg_position
FROM gsc_performance_daily
GROUP BY 1
ORDER BY 1;