Erdem Cice

Marketing analytics pipeline

Synthetic data. Runs in daily CI.

Meta Ads and Google Ads exports modelled against shop-attributed orders and revenue, built on synthetic data.

google_ads_campaign_daily1 testmeta_ads_insights1 testcampaign_mapping8 testsshop_orders2 testsstg_google_ads__campaign_daily5 testsstg_meta_ads__adset_daily7 testsstg_shop__orders7 testsint_ad_spend__campaign_dailyint_orders__attributedfct_campaign_performance_daily8 testsmart_channel_weekly3 tests
  1. google_ads_campaign_daily1 test
  2. meta_ads_insights1 test
  3. campaign_mapping8 tests
  4. shop_orders2 tests
  1. stg_google_ads__campaign_daily5 testsfrom google_ads_campaign_daily
  2. stg_meta_ads__adset_daily7 testsfrom meta_ads_insights
  3. stg_shop__orders7 testsfrom shop_orders
  1. int_ad_spend__campaign_dailyfrom campaign_mapping, stg_google_ads__campaign_daily, stg_meta_ads__adset_daily
  2. int_orders__attributedfrom campaign_mapping, stg_shop__orders
  1. fct_campaign_performance_daily8 testsfrom int_ad_spend__campaign_daily, int_orders__attributed
  2. mart_channel_weekly3 testsfrom fct_campaign_performance_daily, int_orders__attributed

The number on a node counts the tests attached to it. A relationship test is counted on both models it touches, so the numbers add up to more than the 37 tests in total.

Drawn from the dbt manifest of the project. Synthetic data.

What it is

A pipeline that puts the conversions reported by Meta Ads and Google Ads next to the orders the shop can trace. It models ad spend against shop-attributed orders and revenue, so that budget decisions can rest on them.

The data is synthetic. A generator makes exports for a fictional skincare brand: 180 days, 6 campaigns and about 7,000 orders. No client data is involved. Any figure the pipeline produces shows the method, not a finding.

My role

This is my own project. I built it alone.

How it was built

It is built with Python, SQL and dbt on DuckDB. Raw exports are loaded as text. Staging models type and clean them. An intermediate layer attributes orders by last-click UTM through a campaign mapping kept by hand. Two marts come out: campaign performance per day and a weekly summary per channel.

The diagram is drawn from the dbt manifest of the project: 3 sources, 1 seed, 7 models and 37 tests. Three of the tests are custom: spend reconciles with the raw data, paid UTMs are mapped, and attributed revenue stays within total revenue. pytest and the full pipeline run on every push and every day at 06:00 UTC.

What was tried and dropped

Nothing yet. The history is three commits. Still open on the roadmap: a dashboard, a walkthrough video, a postmortem, other attribution models and a way to ask the data questions in plain language.

Where it stands

It works on synthetic data and runs in daily CI. The repository is public on GitHub.

What I learned

The platforms and the shop never share a key, so the mapping between them is the real work. Tests that reconcile totals catch more than tests on single columns.

Next work: Desert Rose Atelier