Skip to content

sodadata/dataos-demo-dbt-conversion-funnel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataOS Demo: E-commerce Conversion Funnel (dbt)

A dbt project that transforms raw e-commerce data into a conversion funnel analysis and customer segmentation model. Designed to run against the DataOS demo Postgres database.

Data Flow

raw.customers ─┐
raw.orders ────┤─→ stg_* ─→ int_customer_events_sessionized ─→ fct_conversion_funnel
raw.products ──┤            int_order_items_enriched ─────────→ fct_revenue_by_region_category
raw.events ────┘                                     └────────→ dim_customer_segments

Source Tables (raw.*)

Table Description
raw.customers 5 customers across US-West, US-East, EU-West, APAC
raw.orders 7 orders (completed, shipped, pending)
raw.products 5 products (Electronics, Furniture)
raw.events 8 clickstream events (page_view, add_to_cart, purchase)

Output Tables (mart.*)

Table Description
mart.fct_conversion_funnel Daily funnel: sessions per step + conversion rates
mart.dim_customer_segments Customer segmentation by LTV tier + activity status (PII-free)
mart.fct_revenue_by_region_category Revenue drill-down by region and product category

Prerequisites

  • The DataOS demo Postgres must be running with seed data:

    # From the dataos repo:
    task demo-seed
  • Python with dbt-postgres:

    pip install dbt-postgres

Usage

# Install dbt packages
dbt deps

# Validate the project
dbt debug

# Run all models
dbt run

# Run tests
dbt test

# Generate and serve docs
dbt docs generate && dbt docs serve

Connection

By default connects to localhost:5433 (the DataOS demo Postgres). Override via env vars:

export DBT_HOST=localhost
export DBT_PORT=5433
export DBT_USER=demo
export DBT_PASSWORD=demo
export DBT_DBNAME=demo

About

Demo dbt project: e-commerce conversion funnel & customer segmentation (companion to DataOS)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors