Skip to main content
Back to Blog
GA4/BigQuery

Building a Marketing Dashboard with GA4 and BigQuery

Hypemarc Data Team
January 18, 2025
Building a Marketing Dashboard with GA4 and BigQuery

Why GA4 Alone Isn't Enough

Google Analytics 4 is a powerful tool, but it hits a wall quickly when you need serious marketing analytics:

GA4's 3 Key Limitations

  1. Segment restrictions — Maximum 4 comparison segments at a time
  2. Data sampling — Large datasets return approximated, not exact, results
  3. Limited custom analysis — Complex funnel and cohort analyses are constrained by the UI

If you've ever spent hours trying to get a specific report out of GA4's interface, only to realize it's simply not possible — you're not alone.

The solution: Connect GA4 to BigQuery.

Marketing data analytics dashboard


What BigQuery Unlocks

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

  • Zero sampling — 100% accurate data, always
  • 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:

  • First 10GB/month: Free
  • After that: $5 per TB queried (most companies spend under $20/month)

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 took 4 hours to compile manually
  • Anomalies discovered 3 days late on average
  • Limited to 4 segment comparisons
After (BigQuery + Hypemarc.AI):
  • Reports auto-generated in 10 minutes
  • Real-time anomaly alerts via Slack
  • 50+ segments analyzed simultaneously
  • Data-driven decision speed: 5x faster

ROI: 30% reduction in monthly ad spend ($15,000 → $10,500) while maintaining the same revenue.


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.

BigQuery transforms GA4 from a reporting tool into a decision-making engine. Whether you build it yourself or use a turnkey solution like Hypemarc.AI, the result is the same: faster decisions, more accurate targeting, and lower costs.

Last Updated: January 18, 2025

AI Agent Adoption

Still doing this by hand?

Repetitive work like SEO, GA4, and data analysis runs automatically with AI agents — from training to adoption and ops, all with Marblo.

Explore AI Agents →

Need More Insights?

Consult with AI marketing experts and grow your business

Contact Us
Building a Marketing Dashboard with GA4 and BigQuery - Hypemarc Blog | Hypemarc