---
title: "Enhancing Google Analytics Data with ClickHouse"
description: "ClickHouse's marketing team moved its Google Analytics 4 data into ClickHouse to get around GA4's sampling, slow interface, limited SQL-style flexibility and short data retention."
url: "https://swe.quest/articles/enhancing-google-analytics-data-with-clickhouse-eb2048c17f27f5ac"
canonical: "https://clickhouse.com/blog/enhancing-google-analytics-data-with-clickhouse"
source: "ClickHouse"
published: "2023-11-16"
difficulty: "medium"
kind: "Case study"
reading_minutes: 19
tags: ["analytics","data-pipelines","sql"]
---

# Enhancing Google Analytics Data with ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2023-11-16, 19 min read, Case study. Original: [https://clickhouse.com/blog/enhancing-google-analytics-data-with-clickhouse](https://clickhouse.com/blog/enhancing-google-analytics-data-with-clickhouse)

## Summary

ClickHouse's marketing team moved its Google Analytics 4 data into ClickHouse to get around GA4's sampling, slow interface, limited SQL-style flexibility and short data retention. The pipeline uses GA4's BigQuery export, which provides a daily table and a streaming intraday table. Scheduled BigQuery queries write Parquet files to GCS: the daily export runs at 6pm, and the hourly intraday export covers a window offset by 15 minutes to catch late events. ClickHouse then ingests the files with the gcs table function or S3Queue into a MergeTree schema that has materialized columns pulled from event\_params. The result is fast, unsampled reporting with indefinite retention, plus external data joined via dictionaries, for under $20 a month on ClickHouse Cloud.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [SQL](https://swe.quest/tags/sql.md) (Languages)

## Prerequisites

- SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- Google Analytics basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- ClickHouse table engines ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

ClickHouse, Google Analytics 4, BigQuery, Parquet, Google Cloud Storage, S3Queue, MergeTree

## Related posts

- [ClickHouse vs BigQuery: Using ClickHouse to Serve Real-Time Queries on Top of BigQuery Data](https://swe.quest/articles/clickhouse-vs-bigquery-using-clickhouse-to-serve-real-time-queries-on-top-of-2c9e02d14f552560.md): ClickHouse · 2023-02-27 · Medium · 25 min read · Analytics & OLAP, Data pipelines, Cloud platforms, SQL
  ClickHouse can sit alongside BigQuery to serve sub-second, high-concurrency analytical queries for real-time applications, while BigQuery remains the warehouse for ad-hoc deep analysis.
- [Why BigQuery can’t match ClickHouse Cloud for real-time analytics](https://swe.quest/articles/why-bigquery-can-t-match-clickhouse-cloud-for-real-time-analytics-fd197ffd824251d5.md): ClickHouse · 2026-10-08 · Medium · 19 min read · Analytics & OLAP, Performance engineering, Cost optimization, Cloud platforms, Data pipelines
  In the CostBench benchmark, ClickHouse Cloud and BigQuery ingest 113.2 billion stock quotes at a target of 1M rows/s while aggregate and drill-down queries run continuously, and ClickHouse Cloud scores 438× better end-to-end performance per dollar under BigQuery Capacity pricing and 512× under On-demand.
- [How FabFunnel powers real-time marketing analytics with ClickHouse Cloud](https://swe.quest/articles/how-fabfunnel-powers-real-time-marketing-analytics-with-clickhouse-cloud-693f5ffb0f0b9887.md): ClickHouse · 2025-11-20 · Medium · 5 min read · Analytics & OLAP, Data pipelines, MySQL, Ads, Performance engineering
  FabFunnel moved its marketing analytics off a normalized MySQL reporting stack, where month-long queries took 11 seconds and year-long reports crashed browsers due to client-side merges, to ClickHouse Cloud.
- [Building a product analytics solution with ClickHouse](https://swe.quest/articles/building-a-product-analytics-solution-with-clickhouse-786424348993d92f.md): ClickHouse · 2024-12-05 · Medium · 24 min read · Analytics & OLAP, SQL, Databases, Product engineering
  ClickHouse's in-house product analytics platform, Galaxy, stores over 20 billion events (14 TB, roughly 14x compression) in a single denormalized MergeTree table keyed on created\_at.
- [How Jump Trading uses ClickHouse with Iceberg for analytics](https://swe.quest/articles/how-jump-trading-uses-clickhouse-with-iceberg-for-analytics-1cafb9464ead1735.md): ClickHouse · 2026-07-30 · Medium · 6 min read · Analytics & OLAP, Data pipelines, Distributed databases, Performance engineering
  Jump Trading runs a self-managed, on-prem ClickHouse cluster of tens of nodes as the system of record for petabyte-scale trading logs, ingesting hundreds of TB per day with peaks of 10M rows/sec and a sub-20-second p99, reconciled daily for zero data loss.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
