← PORTAFOLIOPORTFOLIO / proyectos / etl-bigquery

// PRJ_009 · 2023

ETL de audiencia a BigQueryAudience ETL into BigQuery

Datos · PythonData · Python

Los datos de audiencia de un medio digital estaban repartidos entre dos versiones de Google Analytics. Los llevé a un solo lugar y armé los dashboards del equipo comercial.A digital outlet's audience data was split between two versions of Google Analytics. I brought it into one place and built the sales team's dashboards.

En detalleIn detailProcesos ETL en Python que llevan los datos de audiencia de Universal Analytics y GA4 a BigQuery, con la migración a GA4 hecha sin perder el histórico. Sobre esa base armé los dashboards del equipo comercial.Python ETL processes that bring audience data from Universal Analytics and GA4 into BigQuery, with the GA4 migration done without losing the history. On top of that I built the sales team's dashboards.

RolRole
Desarrollador backend / datosBackend / data developer
AñoYear
2023
CódigoSource
privado — trabajo de empresaprivate — company work
Stack
Python · BigQuery · GA4

// IMPACTO// IMPACT

ConservadoKept
históricohistory
UA + GA4UA + GA4
fuentessources
BigQueryBigQuery
destinosink

El problemaThe problem

Los análisis de tráfico se armaban a mano, exportando de la interfaz de Analytics cada vez. El histórico estaba repartido entre Universal Analytics y GA4, y Universal Analytics iba a dejar de existir.Traffic analyses were assembled by hand, exporting from the Analytics UI every time. History was split between Universal Analytics and GA4, and Universal Analytics was about to be shut down.

Cómo lo resolvíHow I solved it

Escribí procesos ETL en Python que consultan ambas APIs y cargan el resultado en BigQuery con un modelo común. Migré la analítica a GA4 sin perder el histórico, y sobre esa base armé los dashboards del equipo comercial.I wrote Python ETL processes that query both APIs and load the result into BigQuery under a common model. I migrated analytics to GA4 without losing the history, and built the sales team's dashboards on top of it.

Arquitectura y stackArchitecture & stack

  1. [01]Universal Analytics
  2. [02]GA4 Data API
  3. [03]ETL Python
  4. [04]BigQuery
  5. [05]Reportes SQL
  • Python
  • BigQuery
  • GA4
  • SQL

Lo que aprendíWhat I learned

01 //

Dos APIs, un modelo

Lo caro no fue extraer, fue decidir cómo hacer comparables las métricas de UA y GA4.

02 //

El histórico es el activo

Los años de datos acumulados valen más que cualquier dashboard que se construya encima.

03 //

Backfill una sola vez

Cargar el histórico de golpe y dejar el incremental corriendo evita reprocesar para siempre.

01 //

Two APIs, one model

The expensive part wasn't extraction, it was deciding how to make UA and GA4 metrics comparable.

02 //

History is the asset

Years of accumulated data are worth more than any dashboard built on top of it.

03 //

Backfill once

Loading history in one pass and leaving the incremental running avoids reprocessing forever.