Marketing analytics dashboard showing unified multi-channel attribution, ROI breakdown, and ML-powered budget allocation recommendations
All Projects
D2C E-Commerce & RetailAI & Machine LearningData EngineeringFull-Stack Development

AI-Powered Marketing Analytics: Unifying 12 Ad Channels Into One ROI Engine

Delivered a 280% ROI lift and unified 10M+ monthly data points for a D2C brand spending $200K/month across fragmented ad channels.

+280%ROI Improvement
10M+/moData Points Ingested
12Channels Unified
95%Reporting Time Saved

THWORKS built an AI-powered marketing analytics platform for a D2C skincare brand running $200K/month across 12 ad channels with no unified ROI view. Using Python, TensorFlow, and ClickHouse, we engineered a multi-touch attribution engine that ingests 10M+ daily events from Meta, Google, TikTok, email, and affiliate sources, then uses ML to reallocate budget toward the highest-performing touchpoints in real time. Result: 280% ROI improvement within 90 days, 95% reduction in manual reporting, and a single source of truth for the entire marketing team.

The Challenge: $200K/Month Spend With Zero Unified Attribution

A fast-growing D2C skincare brand was scaling ad spend past $200,000/month across 12 paid channels — Meta, Google, TikTok, Pinterest, Snapchat, email, affiliate networks, and more — but every channel reported its own inflated ROAS using last-click attribution. The marketing team spent 20+ hours weekly manually stitching together CSV exports into spreadsheets, and decisions about where to shift budget were based on intuition rather than data. An estimated 30% of spend was going to channels that looked profitable in isolation but were actually cannibalizing each other.

In 2026, privacy changes (iOS, GDPR, cookie deprecation) have broken platform-native tracking, making it nearly impossible to get an honest view of channel performance from vendor dashboards. The client needed an independent, first-party attribution model that could survive signal loss — and a system that could recommend budget moves based on actual marginal ROI, not vanity metrics.

Our Solution: ML-Based Attribution Engine with Real-Time Budget Recommendations

We built a unified analytics pipeline with three layers. First, an ingestion layer that pulls raw event data from every ad platform API plus server-side tracking from the brand's Shopify store into a ClickHouse warehouse. Second, a TensorFlow-based Markov chain attribution model that assigns conversion credit across touchpoints based on actual sequence contribution, not last-click. Third, a React dashboard that surfaces real-time ROI, cohort performance, and ML-generated budget reallocation suggestions.

Instead of replacing the team's existing tools (which would have caused adoption friction), we built the platform as a 'decision layer' on top of them. Marketers continue using Meta Ads Manager and Google Ads as execution tools — but every morning they see a dashboard that tells them which campaigns are over-funded, which are under-funded, and which creatives are losing efficiency. The ML model retrains nightly on the previous 90 days of data.

Key Technical Decisions

First-Party Server-Side Tracking: Deployed a custom server-side tracking layer to bypass iOS ATT and third-party cookie blocking — captures 94% of conversion events vs. 62% for platform-only tracking.

Markov Chain Attribution: Chose Markov chains over Shapley values because they're interpretable to non-technical marketers and run 40x faster on large datasets — enabling daily retraining instead of weekly.

ClickHouse Over Snowflake: Picked ClickHouse for the warehouse because the workload is analytical with heavy aggregations and low-concurrency — cutting monthly warehouse costs from a projected $4,000 to $380.

Results: 280% ROI Lift in 90 Days

280%
ROI Improvement
10M+
Data Points / Month
95%
Reporting Time Saved

Before

20+ hours weekly stitching CSVs from 12 dashboards. Last-click attribution inflating ROAS by 40-60%. Budget decisions based on intuition and platform-native numbers. An estimated 30% of spend going to cannibalizing channels.

After

Single unified dashboard with real-time cross-channel ROI. ML-driven budget reallocation suggestions delivered daily. 95% reduction in manual reporting time. 280% improvement in blended ROI as budget shifted to truly profitable channels.

Technology Stack

PythonPowers the ML attribution engine, ETL orchestration, and platform API connectors — ideal for data-heavy analytical workloads.
TensorFlowRuns the Markov chain attribution model and budget optimization algorithms with GPU acceleration for nightly retraining.
ClickHouseColumn-oriented warehouse handling 10M+ daily events with sub-second analytical queries at 10% of Snowflake's cost.
Apache AirflowOrchestrates data pipelines from 12 ad platform APIs plus Shopify, with retry logic and SLA monitoring.
React + RechartsInteractive marketer-facing dashboard with drill-down cohort analysis and ML recommendation panels.
PostgreSQLStores user configurations, historical model outputs, and dashboard state — complements ClickHouse for operational data.
"Before THWORKS, we were flying blind with $200K/month in spend. The platform paid for itself in the first 30 days just by showing us which campaigns were cannibalizing each other. Our blended ROAS went from 2.1x to 5.8x in a single quarter — and we finally have a single number our whole team agrees on."
Priya VenkatesanVP of Growth, Lumen Skincare

Frequently Asked Questions

Common questions about this project and our approach.

Multi-touch attribution distributes conversion credit across all marketing touchpoints a customer interacted with before purchasing, rather than crediting only the last click. Our Markov chain model calculates the incremental contribution of each touchpoint by simulating what would happen if that channel were removed — giving an honest view of each channel's real impact rather than inflated last-click numbers.

Related Projects

Build Your Marketing Analytics Platform

Let's discuss how we can engineer the same level of technical excellence for your project.

Build Your Marketing Analytics Platform