From ETL to Insight: Building Reliable Data Pipelines
A pipeline is only useful if people trust the number at the end of it. This is how I built one that joins GA4 data in BigQuery with Google Ads spend, and what made it reliable enough to act on.
01Two systems, one question
The marketing team had a simple question: what do our paid campaigns actually deliver? The answer was split across two systems. Ad spend lived in Google Ads. Conversions and user behaviour lived in GA4.
Comparing the two meant manual exports and spreadsheets, so campaign decisions were slow and hard to trust. The GA4 Paid Traffic Dashboard replaced that with a pipeline.
02The pipeline, end to end
Extract GA4 events from BigQuery
GA4 events are exported daily into date-partitioned BigQuery tables, and the event data is queried there directly with SQL.
Select the right partitions
Parameterised table IDs pick the partitions for any reporting window, so the same query serves any date range.
Extract spend from the Google Ads API
Campaign spend is fetched through the Google Ads API instead of a manual export.
Join and compute
Events and spend are combined to measure performance per campaign.
Serve and schedule
Results are served through a Django REST Framework backend backed by PostgreSQL, and reports are emailed on a schedule by APScheduler.
03What made it reliable
Validate the join before you trust the join
A join between ad clicks and GA4 sessions is only as good as the tracking that links them, and that tracking was unreliable. I validated GCLID and UTM tracking with statistical analysis and A/B testing, reaching 100% data accuracy. Everything downstream depends on this step.
Parameterise instead of hard-coding
Daily partitioned tables invite one-off queries with dates typed in by hand. Parameterising the table IDs means the right partitions are selected automatically, and nobody edits SQL to change a reporting window.
Take people out of the delivery step
A report that depends on someone remembering to run it is not a pipeline. Scheduled email delivery means the numbers arrive without a manual pull.
04The same pattern, a different source
The sources change, the shape does not. At Jolly Clamps the inputs are not APIs but daily Excel exports from the ERP and production-planning systems: dispatch, lead time, MPS / MTO schedules and forecast demand.
Every export type has its own Excel layout, so the ERP Data Automation Portal uses a reusable openpyxl parser library that maps each export into a consistent data model. Parsed data is stored in structured PostgreSQL models through Django REST Framework, and recurring reports are generated automatically. A repeatable ingestion pipeline replaced daily manual spreadsheet handling.
05Takeaways
- Start from the question the team is asking, then find where each half of the answer lives.
- Check the keys that link your sources before you build anything on the join.
- Parameterise date ranges and table names so no one edits a query by hand.
- Map messy inputs into one consistent data model as early as possible.
- Automate delivery, so the pipeline does not depend on anyone's memory.