Problem
Finance and campaign data often sit in different analytical paths, which makes profitability after ad spend harder to inspect in one reporting surface.
archive case study
A dbt analytics engineering case study that unifies e-commerce finance reporting with paid marketing performance. It runs on BigQuery and on a DuckDB twin that CI builds and tests on every pull request.
Quick technical review
Finance and campaign data often sit in different analytical paths, which makes profitability after ad spend harder to inspect in one reporting surface.
dbt separates staging, intermediate, and mart logic. The same code runs on BigQuery and on DuckDB through cross-adapter macros, and a source_system variable switches the raw input between the original ad-platform tables and a Google Sheets export.
Creates unified finance and marketing marts for reporting use, including ads_margin for profitability after marketing spend.
The default mode is verified on synthetic seed data because the raw warehouse dataset is empty. ROAS exists only at the blended level, since revenue is not attributed to a source. The sheet export has a refund column whose meaning is unconfirmed, so…
The default mode is verified on synthetic seed data because the raw warehouse dataset is empty. ROAS exists only at the blended level, since revenue is not attributed to a source. The sheet export has a refund column whose meaning is unconfirmed, so it is reported separately and never subtracted from revenue or margin. The dashboard is a demo, not a BI product.
Summaries reuse the project’s documented evidence. Review the complete case study for evaluation boundaries.
Evidence-led visual review
Concept art, dated captures and repository figures are identified separately.
Portfolio illustration
Original portfolio illustration. Diagrams are conceptual; verified methods and results appear in the linked case study. This is not an application screenshot.
Project proof
Last verified 2026-10-06
Problem and approach
Finance and campaign data often sit in different analytical paths, which makes profitability after ad spend harder to inspect in one reporting surface.
dbt separates staging, intermediate, and mart logic. The same code runs on BigQuery and on DuckDB through cross-adapter macros, and a source_system variable switches the raw input between the original ad-platform tables and a Google Sheets export.
Finance reporting is extended with campaign cost and performance data: ads_margin for profitability after ad spend, blended ROAS, and per-source CPC and CTR. Every ratio is a ratio of sums, never an average of daily ratios, and a zero denominator gives NULL.
CI runs dbt seed and dbt build on DuckDB for both source modes (schema tests, reconciliation tests, unit tests) plus a headless dashboard smoke test. The BigQuery run was a read-only query that returned the same numbers as DuckDB.
The default mode is verified on synthetic seed data because the raw warehouse dataset is empty. ROAS exists only at the blended level, since revenue is not attributed to a source. The sheet export has a refund column whose meaning is unconfirmed, so it is reported separately and never subtracted from revenue or margin. The dashboard is a demo, not a BI product.
This repo shows analytics engineering with the checks left in: structured marts, reusable business logic, tests that actually run, and an honest account of what the data can and cannot support.
Architecture and analysis
Testing and validation
Operational value
How to inspect