Attribution is the part of a marketing-AI product where the engineering and the honesty have to arrive together. Shipping a dashboard that assigns tidy credit to every channel is easy. Shipping one whose numbers survive a skeptical CFO asking "how do you know?" is hard, because the truthful answer is often "we are estimating, under these assumptions, and here is our confidence." A build that hides that fact gives founders a false sense of certainty they will act on with real budget.
This post is the engineering companion to our broader guide to AI engineering for marketing, focused on one hard sub-problem: measuring which marketing worked. It is written for founders and CTOs building attribution or analytics into a product, and it maps to what we ship on our AI marketing attribution practice.
The problem underneath every attribution product
Start with the fact that breaks naive dashboards: every ad platform claims the same conversion. Meta, Google, TikTok, and LinkedIn each report the sale as theirs, by design, using their own attribution windows and their own view of the click or view that preceded it. Sum four platform dashboards and you will "attribute" far more conversions than happened. The platforms are not lying; each answers "did I contribute?" and each says yes.
The first job of an attribution system is reconciliation, not modeling. You need one schema that holds spend, impressions, and platform-claimed conversions side by side, de-duplicated against your own first-party conversion events. Only after the same event is represented once, in one place, can a model arbitrate credit. This is a data-engineering problem before it is a data-science one, which is why attribution work leans on the same warehouse-native discipline we describe under data engineering.
Three methods that answer three different questions
There is no single correct attribution model, because "which channel gets credit" is several different questions. We ship more than one method and let teams compare them, rather than betting the product on a single number.
Multi-touch attribution: operational, journey-level credit
Rule-based models (first-touch, last-touch, linear, time-decay) and algorithmic ones (data-driven, Markov chains, Shapley values) run over a unified event graph and allocate credit across the touchpoints in a journey. These answer operational questions: which sequences of touches tend to precede conversion? The critical engineering discipline is surfacing the assumptions. A Shapley-value model is not "the truth"; it is a specific fairness axiom applied to your event data. Ship the assumptions in the UI, not buried in a black box.
Marketing mix modeling (MMM): budget allocation, privacy-safe
MMM takes a step back and regresses outcomes against spend at an aggregate level, modeling adstock (the carry-over effect of advertising over time) and saturation (diminishing returns as spend climbs). Regression and Bayesian MMM, commonly built on PyMC-based stacks or open frameworks like Meta Robyn and Google Meridian, answer "if I move budget from channel A to channel B, what happens?" Because MMM works on aggregates, it degrades gracefully as third-party signal disappears. The non-negotiable engineering rule: report confidence intervals alongside every point estimate. An MMM that hides its uncertainty is worse than no MMM, because it launders a wide range of plausible outcomes into one confident-looking number.
Incrementality testing: the closest thing to causation
Neither of the above proves that a channel caused conversions; they allocate credit under assumptions. For causal claims you need experiments: geo holdouts, PSA control groups, and conversion-lift studies. This is the ground truth the other two methods should be calibrated against. It is also the honest answer to a founder asking "did this campaign move the needle?": you run a controlled test, you do not read it off a click path.
Identity resolution: the layer that makes or breaks the graph
None of these methods work if you cannot stitch touchpoints into journeys. Identity resolution, connecting sessions and devices to a single user, is where accuracy is won or lost. The defensible architecture is deterministic-first (known identifiers, logins, hashed emails) with probabilistic stitching layered on only where it earns its place, and every match tagged with a confidence tier so downstream models can weight or exclude low-confidence links. Treat identity as a first-class datastore with the same rigor as your primary database, because that is what it is.
Building for the post-cookie world
Third-party cookies are a degrading signal, and an attribution product architected around them is quietly fragile. Build on first-party events and server-side conversion APIs, keep the deterministic identity graph as the backbone, and shift measurement weight toward MMM and incrementality as click-level signal erodes. Done this way, a browser policy change doesn't silently break your customers' reporting.
This is also where privacy stops being a footnote. Consent state has to be captured at the event layer and enforced before modeling: an un-consented touchpoint should never earn attribution credit, and a suppressed user should drop out of the identity graph and every downstream model. That is an engineering property, not a policy PDF. We build the controls; how we approach the regulatory side is described on our GDPR page.
What we'd tell you before quoting a build
The most valuable thing an attribution partner can do early is tell you what your data can't support. If you don't have holdout capability, we won't promise causation. If your first-party event coverage is thin, we'll say the identity graph will lean probabilistic and carry more uncertainty. Being honest about this up front is cheaper than discovering it after launch, which is exactly what a diagnostic like our Tech Audit is for.
If you want a fast read on where your current stack over- or under-credits a channel, the AI Marketing Stack Audit is a free starting point. And if you are building an attribution product end to end, that is a concentration area for us; see the AI marketing attribution practice or the broader AI marketing engineering overview for how the pieces fit together.
The through-line: attribution is a measurement product, and measurement products earn trust by being explicit about their limits. Build the reconciliation layer properly, ship more than one method, surface every assumption, and let incrementality keep you honest.