WorkDTC E-commerce7 min read

Lower CAC at Scale With First-Party Multi-Touch Attribution and Revenue Feedback to the Ad Platforms

First-party, server-side tracking and data-driven attribution that reveal which channels truly drive new revenue, then feed that value back to Google and Meta so the algorithms optimize on reality, not last click.

The client is a DTC brand scaling paid acquisition across Meta, Google, and TikTok. Every platform claimed credit for the same sale in its own dashboard, so reported ROAS added up to more revenue than the business actually made. Last click overcredited branded search and retargeting and starved the channels that introduce new customers. With third-party cookies fading and iOS signal degraded, the picture was getting worse, not better.

Client profile
A DTC e-commerce brand, ~$40M revenue, scaling paid acquisition across Meta, Google, and TikTok
Industry
DTC E-commerce
Region
North America / UK

01 The Challenge

Three platforms, each taking credit for the same sale

~30%Of conversions invisible to the pixelLost to cookie loss, ATT, and ad blockers

Meta, Google, and TikTok all report the same purchase, so their numbers cannot be added up and none of them describe the real journey. Last-click attribution, the default in every ad manager, hands the credit to the final touch, which means branded search and retargeting look like heroes while prospecting and TikTok look like waste, even when they are what started the purchase.

It was also getting harder to even see. Third-party cookie loss, iOS ATT, and ad blockers had quietly eaten a chunk of the conversion signal, so the pixels under-reported and the bidding algorithms were optimizing on a shrinking, biased sample.

The team was about to cut a channel that last click called a loser. It might have been the one bringing the new customers in.

02 The Approach

Own the first-party signal, credit it with real models, feed the truth back

The governing rule: one identity-resolved journey per customer, credited by data-driven models, with the resulting value fed back to the platforms so they optimize on reality.

Three deliberate decisions:

- First-party and server-side. Collection runs on the brand's own domain, server-side, and is consent-aware, so it survives cookie loss and ad blockers and produces a cleaner, fuller signal than the browser pixel. - More than one model. Last click stays visible as the baseline, but credit is assigned by Markov chains (removal effect) and Shapley values, reconciled, so no single model is trusted blindly and Growth can see exactly how last click was distorting the picture. - Close the loop. The modeled value is pushed back to Google Ads and Meta so value-based bidding optimizes toward true incremental revenue.

What we deliberately did not do: no probabilistic device fingerprinting (deterministic first-party identity only), no black-box single number, and no media buying on the client's behalf. We make the truth visible and machine-readable; the team and the ad algorithms act on it.

03 The Build

A snippet, a fast collector, identity-resolved journeys, and a feedback loop

A lightweight TypeScript snippet emits first-party events to the brand's own domain. A Rust collector receives them at ad-traffic scale, validates and enriches each event, and writes to Kafka. From there events land in ClickHouse for sub-second journey queries, while an identity service stitches anonymous visitors to known customers deterministically at login and checkout, tying every journey to a real Shopify order. Python builds the journeys and runs the attribution models (Markov, Shapley, blended, against a last-click baseline). The modeled, deduplicated conversion values are then pushed to Google Ads (offline conversion import and Enhanced Conversions) and Meta CAPI, with Temporal guaranteeing each conversion is uploaded exactly once. A TypeScript dashboard lets Growth compare models and see true channel and campaign performance.

The whole pipeline runs on AWS via Terraform, with Aurora PostgreSQL holding the identity graph.

  • Rust
  • TypeScript
  • Kafka
  • ClickHouse
  • Python
  • Temporal Cloud
  • Google Ads
  • Meta CAPI
  • AWS

04 The Results

Spend follows the channels that actually create customers

-22%Blended CACAfter moving budget to truly incremental channels

Server-side first-party collection recovered roughly 30% of the conversions the pixel had been missing, so the algorithms started learning from a fuller, cleaner signal. Markov and Shapley revealed that last click had been overcrediting branded search and retargeting and undercrediting top-of-funnel prospecting. Reallocating budget toward the channels that genuinely introduced new customers, while feeding modeled value back to Google and Meta daily, brought blended CAC down about 22% without cutting revenue. Growth now plans against true channel contribution instead of three dashboards that never agreed.

05 What's Next

Margin-aware bidding, and a signal spine the brand owns

The brand now owns its conversion signal end to end, which is the hard part. The next step is to feed contribution margin, not just revenue, into the bidding loop (pairing this with the costed-margin model), so the platforms optimize toward profit rather than top-line. The same first-party event spine also becomes the foundation for retention and lifecycle analytics.

Consumer Goods (CPG)6 min read

Stopping Retail Chargebacks Before They Hit With Per-PO OTIF Risk Prediction

A real-time layer over the existing order flow that scores every purchase order for on-time-in-full risk and alerts the team to intervene before the delivery window closes and the fine triggers.

-85%Compliance and OTIF chargebacks
  • OTIF
  • Chargeback Prevention
  • Temporal
  • Retail
Read

Dental7 min read

A 24/7 Front Desk That Books Patients and Refuses to Play Doctor

A governed AI assistant that answers admin enquiries from approved practice information and books through Dentally, escalates anything clinical with a hard safety gate, and never gives clinical advice, with staff reviewing every non-templated reply.

70%Of enquiries resolved without the front desk (booking, FAQs, hours)
  • AI Workflow
  • Governed
  • Clinical-Safety Gate
  • Dentally
Read

Engineering edge,
without hiring a team.

Numbers you can trust, operations that run themselves, all built into your stack and owned by you. Tell us where you want the edge, and we'll build it.

Have a project in mind?

  • Quick response

    You'll hear from an engineer the same working day, not a sales sequence.

  • Clear next steps

    A short call, then a plan, and we start with Proof Week or a full build.

  • Fixed fee first

    A fixed fee agreed before anything starts, for Proof Week or the full build.