Skip to main content
← Blog
GA4/BigQueryHypemarc Data Team

Building a Marketing Dashboard with GA4 and BigQuery

Building a Marketing Dashboard with GA4 and BigQuery

Why GA4 Alone Isn't Enough

Google Analytics 4 covers standard reporting well, but it runs into limits once you need deeper marketing analysis:

GA4's 3 Key Limitations

  1. Segment restrictions: Maximum 4 comparison segments at a time
  2. Data sampling: Large datasets return approximated results
  3. Limited custom analysis: The UI constrains complex funnel and cohort analyses

If you've ever spent hours trying to get a specific report out of GA4's interface, only to find the interface can't produce it, you're not alone.

The solution: Connect GA4 to BigQuery.

Marketing data analytics dashboard


What BigQuery Adds

1. Unlimited Segmentation

GA4 UI: 4 segments max. BigQuery: 100, 1,000, or more segments in a single query.

-- Compare 50+ segments in one query
SELECT
  user_segment,
  COUNT(DISTINCT user_pseudo_id) as users,
  SUM(ecommerce.purchase_revenue) as revenue
FROM `project.dataset.events_*`
GROUP BY user_segment

2. Raw, Unsampled Data

  • No sampling: queries run on the full exported dataset
  • Event-level data access
  • Individual user journey analysis

3. Real-Time Automated Alerts

Set up alerts for business-critical changes:

-- Alert when daily revenue drops 20% below target
SELECT
  PARSE_DATE('%Y%m%d', event_date) as date,
  SUM(ecommerce.purchase_revenue) as daily_revenue
FROM `project.dataset.events_*`
WHERE _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d', CURRENT_DATE())
GROUP BY date
HAVING daily_revenue < (SELECT target_revenue * 0.8 FROM targets)

Pipe the results to Slack, email, or your team's notification channel.

4. AI-Powered Insights

With your data in BigQuery, you can layer on AI analytics:

  • Automatic anomaly detection ("Conversion rate dropped 15% vs. yesterday")
  • Predictive modeling ("This segment has 73% probability of churning")
  • Pattern discovery ("Users from organic search who view 3+ blog posts convert at 4x the average")

5. Cross-Platform Data Integration

BigQuery becomes your single source of truth by combining:

  • GA4 (web behavior)
  • Google Ads + Meta Ads (advertising performance)
  • CRM data (customer information)
  • ERP data (inventory, revenue)

GA4 to BigQuery Setup: 3 Steps

Step 1: Create a BigQuery Project (5 minutes)

  1. Go to Google Cloud Console
  2. Create a new project
  3. Enable the BigQuery API

Cost:

  • Free each month: 10 GiB of storage and 1 TiB of queries
  • After that: $6.25 per TiB queried (on-demand, per Google Cloud's official pricing page as of 2026-10-19)

Step 2: Link GA4 to BigQuery (3 minutes)

  1. In GA4: Admin → BigQuery Links
  2. Select your BigQuery project
  3. Choose streaming or daily export

Recommendation: Start with daily export (free), upgrade to streaming when needed.

Step 3: Run Your First Query (10 minutes)

-- Yesterday's total visitors
SELECT
  COUNT(DISTINCT user_pseudo_id) as total_users
FROM `your-project.analytics_XXXXXX.events_*`
WHERE _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY))

5 Ready-to-Use SQL Templates

1. Daily Core Metrics

SELECT
  PARSE_DATE('%Y%m%d', event_date) as date,
  COUNT(DISTINCT user_pseudo_id) as users,
  COUNT(*) as events,
  COUNTIF(event_name = 'purchase') as purchases,
  SUM(ecommerce.purchase_revenue) as revenue
FROM `project.dataset.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20250101' AND '20250131'
GROUP BY date
ORDER BY date DESC

2. Top Traffic Sources

SELECT
  traffic_source.source,
  traffic_source.medium,
  COUNT(DISTINCT user_pseudo_id) as users,
  COUNTIF(event_name = 'purchase') as conversions
FROM `project.dataset.events_*`
WHERE _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY))
GROUP BY source, medium
ORDER BY users DESC
LIMIT 10

3. Purchase Funnel Analysis

WITH funnel AS (
  SELECT
    user_pseudo_id,
    COUNTIF(event_name = 'view_item') > 0 as viewed,
    COUNTIF(event_name = 'add_to_cart') > 0 as added_to_cart,
    COUNTIF(event_name = 'begin_checkout') > 0 as began_checkout,
    COUNTIF(event_name = 'purchase') > 0 as purchased
  FROM `project.dataset.events_*`
  WHERE _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY))
  GROUP BY user_pseudo_id
)
SELECT
  COUNTIF(viewed) as step_1_view,
  COUNTIF(added_to_cart) as step_2_cart,
  COUNTIF(began_checkout) as step_3_checkout,
  COUNTIF(purchased) as step_4_purchase,
  ROUND(COUNTIF(purchased) / COUNTIF(viewed) * 100, 2) as overall_conversion_rate
FROM funnel

4. Cohort Retention Analysis

WITH first_visit AS (
  SELECT
    user_pseudo_id,
    MIN(PARSE_DATE('%Y%m%d', event_date)) as cohort_date
  FROM `project.dataset.events_*`
  GROUP BY user_pseudo_id
)
SELECT
  f.cohort_date,
  COUNT(DISTINCT f.user_pseudo_id) as cohort_size,
  COUNTIF(DATE_DIFF(PARSE_DATE('%Y%m%d', e.event_date), f.cohort_date, DAY) BETWEEN 1 AND 7) as day_7_active,
  COUNTIF(DATE_DIFF(PARSE_DATE('%Y%m%d', e.event_date), f.cohort_date, DAY) BETWEEN 1 AND 30) as day_30_active
FROM first_visit f
JOIN `project.dataset.events_*` e USING(user_pseudo_id)
GROUP BY cohort_date
ORDER BY cohort_date DESC

5. Revenue by Product Category

SELECT
  items.item_category as category,
  COUNT(DISTINCT user_pseudo_id) as buyers,
  SUM(items.quantity) as units_sold,
  SUM(items.item_revenue) as revenue,
  ROUND(SUM(items.item_revenue) / COUNT(DISTINCT user_pseudo_id), 2) as avg_revenue_per_buyer
FROM `project.dataset.events_*`,
  UNNEST(items) as items
WHERE event_name = 'purchase'
  AND _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
GROUP BY category
ORDER BY revenue DESC

From BigQuery to Dashboard

Once your data is in BigQuery, you have several visualization options:

Option A: Looker Studio (Free)

  • Direct BigQuery connector
  • Drag-and-drop dashboard builder
  • Shareable links for team access
  • Best for: Basic dashboards, budget-conscious teams

Option B: Hypemarc.AI Dashboard

  • One-click BigQuery integration
  • AI-powered anomaly detection
  • Automated insights delivered to Slack/email
  • Natural language queries ("Show me conversion rate by channel this week")
  • Best for: Teams who want AI insights without SQL

Option C: Custom Build

  • Tableau, Power BI, or custom web dashboard
  • Full flexibility and control
  • Best for: Enterprise teams with existing BI infrastructure

Real-World Success Story

Fashion E-commerce Brand

Before (GA4 only):
  • Weekly reports were compiled by hand and took hours
  • Anomalies were often found days after they started
  • Limited to 4 segment comparisons
After (BigQuery + Hypemarc.AI):
  • Reports generated automatically
  • Real-time anomaly alerts via Slack
  • Many segments analyzed in one query
  • Decisions made on current data instead of last week's report

Result: The team found and cut underperforming ad spend sooner while keeping revenue steady.


Getting Started

DIY Path

  1. Create BigQuery project
  2. Link GA4
  3. Use the SQL templates above
  4. Build Looker Studio dashboard

Estimated time: 2-3 weeks (SQL experience required)

Hypemarc.AI Turnkey Solution

  1. Single onboarding meeting
  2. Automated setup and integration
  3. Custom dashboard delivered
  4. AI insights activated

Time to value: 3 days

Request Free Demo →


Conclusion

Every marketer has data. Few have insights.

With BigQuery, you can query, alert on, and act on your GA4 data instead of reading standard reports. Whether you build it yourself or use a turnkey solution like Hypemarc.AI, the goal is the same: faster decisions, more accurate targeting, and lower costs.

Last Updated: January 18, 2025

Wrapping up

The Hypemarc Builder Community will keep sharing what we learn while building and operating AI agents, along with resources worth exploring. We'll continue gathering useful resources to share with fellow builders.

Keep reading

Follow the build notes and measured write-ups through RSS.

See all channels →

Reviewing this at work? Bring it to your team

Building a Marketing Dashboard with GA4 and BigQuery | Hypemarc