Katarzyna Stępień
Overview
All work

Analytics engineering · SQL · DuckDB

Where do users drop off?

A reproducible SQL ELT for product conversion-funnel analytics, built on a bronze, silver and gold model and running on DuckDB.

The questions

Which funnel step loses the most people, which device converts best, how much traffic is bots.

What I built

One idempotent SQL pipeline: raw tracker JSON in, cleaned tables, then dashboard-ready metrics.

Quality

Six explicit data-quality rules, each run as a live check.

SQLDuckDBMedallion architectureData quality

The layers

Bronze

raw_sessions and raw_pages: the tracker JSON loaded as it arrived.

Silver

clean_sessions and clean_pages: device names normalised, impossible durations nulled, timestamps parsed, missing countries set to UNKNOWN, sessions under 5 seconds flagged as suspicious, and a load timestamp for audit.

Gold

gold_funnel_metrics: sessions, average duration, CTA clicks, conversions and conversion rate per funnel step, from Awareness to Decision.

gold_device_metrics: click-through and conversion rate per device.

Data-quality rules

IDRiskMitigation
DQ-1Null primary keysDrop rows with a null session or user id
DQ-2Inconsistent device casinglower(trim(device)) in Silver
DQ-3Unrealistic durationsNull out values below 0 or above 7,200 s
DQ-4Unparseable timestampstry_cast to NULL instead of failing
DQ-5Sessions with no matching pageLEFT JOIN and monitor the unmatched rate
DQ-6Duplicates on re-runsIdempotent rebuild and a load-time audit column

The pipeline is idempotent: every section starts with DROP ... IF EXISTS, so it can run any number of times with the same result.

See all work