Back to Portfolio

Product Analytics Pipeline

Scalable Business Intelligence. Processing millions of e-commerce events to drive ROI Optimization.

Executive Summary: ROI Optimization & Scalability

Drawing on my background managing Financial Operations Risk at State Street and advanced technical training from my MSc in Data Science at MMU, I architected this Scalable Business Intelligence engine. It transcends simple metric tracking by transforming millions of raw e-commerce events into precise financial levers, specifically targeting Customer Lifetime Value (CLV) and funnel velocity. By engineering a high-performance pipeline, this system directly empowers data-driven ROI optimization and strategic decision-making at scale.

Elite-Tier Analytical Modules

Module A: Cohort Retention Heatmap

Utilizing logic from 08. Cohort_analysis.sql, this module defines a cohort by the user's first purchase date. It dynamically tracks the percentage of users returning on Day 1, Day 2, etc., mapping critical Customer Lifetime Value (CLV) metrics via high-performance TEMPORARY TABLES.

Module B: Behavioral Speed-to-Conversion

Calculates user intent velocity using TIMESTAMPDIFF logic from 06. advanced_analytics.sql. By extracting the exact minutes elapsed between a user's first view and their first purchase, it models funnel friction through median distribution histograms.

System Architecture

Optimized Ingestion

Engineered to process 1M+ rows in seconds using LOAD DATA LOCAL INFILE and bypassing heavy global checks.

MySQL Optimization

Query speed optimized via targeted idx_event_category and event_type indexing for sub-second latency.

Performance Engineering

Complex aggregations run on TEMPORARY TABLES to ensure memory safety on massive behavioral logs.

Python (Pandas/NumPy)

Automated data integrity checks for missing category_code values and pricing anomalies.

Product Analytics Engine

Interactive visualization simulating the dynamic Python/SQL filtering logic.

User Funnel

Views (100k)100%
Cart (30k)30%
Purchase (8.5k)8.5%

Top 5 Trending Products (By Revenue)

Product ID Category Revenue ($)

Time-to-Conversion (Minutes)

0-15m15-30m30-60m1-2h120m+

Hourly Conversion Rate

00:0006:0012:0018:0023:00

Cohort Retention Heatmap (CLV)

CohortD0D1D3D7
Oct-01
100%
45%
25%
Oct-08
38%
Oct-15
api/main.py — Dynamic Python/SQL Logic
Live Updating
@app.get("/api/v1/analytics/dashboard")
def get_dashboard_data(category: str = "All"):
    # Base logic utilizing idx_event_category
    query_condition = ""
    
    # 1. Fetch Funnel using TEMPORARY TABLES
    # 2. Execute TIMESTAMPDIFF for Speed-to-Lead
    # 3. Aggregate Top Products by Revenue
    # 4. Extract Hourly Conversion & Cohort Matrix
    
    return db.execute(query_condition)
View Project on GitHub