Prompt Engineering for Attribution: The Myth of the Perfect Question
A better prompt changes how a question becomes a query, not the answer key attribution lacks. Ask one question five ways on your own export and see which numbers survive.
Three platforms, three answers, one budget to defend. Your GA4 export already holds the answer, and the first finding is free and never leaves your browser. Get your first finding free
By Joris van Huët, Founder & CEOUpdated 4 min read
There is no perfect question: a better specification raises the odds of a right analysis without making it right. Ask your own question five ways on one export and see which numbers survive.
Can a better prompt fix an attribution answer?
Evidence (preprint, September 2026): CausalVerify, from Madrid academics, scores language models' causal analyses end to end across difference-in-differences, event-study, instrumental-variable and regression-discontinuity designs. Joint recovery means getting both the effect estimate and its standard error right, and a seed is one simulated dataset. The authors conclude that "a plausible method and runnable code do not guarantee recovery".
What it does not show: marketing data, or a prompt test. The design swap is the nearest thing to a better prompt that this post cites, and it is not a prompt test. On the two newest follow-up pairs, the gain was confined to models from the family that built the references.
Is the SQL problem already solved?
Largely on one setting, and less so on the others. Evidence (benchmark and leaderboard): Spider 2.0, an ICLR 2025 benchmark of 632 real-world text-to-SQL problems, reports that its code agent on o1-preview solved 21.3% of them (Lei et al., 2025).
What it does not show: the benchmark scores results against gold answers, and "what did paid social cause?" has none in an orders export. That is reasoning from how the benchmark is built, not a finding.
Does the wording of a question change the verdict?
Evidence (peer-reviewed, PNAS 2026; Amazon AWS and Carnegie Mellon authors): across three datasets, independent AI analysts given the same hypothesis showed "substantial dispersion in effect sizes", p-values and conclusions, and reassigning the persona or the model "shifts the distribution of results even among methodologically sound runs" (Bertran, Fogliato and Wu). OpenAI's guide adds that even different snapshots of one model family "could produce different results."
Those datasets were a soccer-referee study, a coding trial and an election survey, not marketing exports. No source cited here measures how far prompt wording moves an attribution split on marketing data.
Does "control for seasonality" make the answer causal?
Not by itself. Evidence (peer-reviewed journal, 2019): in 15 Facebook ad experiments, "the observational methods often fail to produce the same effects as the randomized experiments, even after conditioning on extensive demographic and behavioral variables" (Gordon et al., Marketing Science, Kellogg and Facebook authors). That paper tested statistical methods, not prompts; a prompt asking for more conditioning asks for the same adjustment.
Opinion: treat a prompt as a hypothesis about what your question means, and a holdout as the answer key. An assistant that writes both the query and the verdict grades its own homework.
How do you test a prompt on your own data?
Run this on your own export:
- Fix the inputs. Pick one date range. Export Shopify orders and GA4's channel report for it, in one time zone and currency.
- Ask five ways. In five fresh chats, ask for revenue by channel: last touch, first touch, "what drove", "what caused", and once with "control for seasonality". Save the query or calculation behind each answer.
- Reconcile. Each answer's total orders and revenue should equal Shopify's for that range. Pass: equal to the order. Fail: any gap, meaning rows were dropped or counted twice.
- Compare the splits. Pass: the splits differ only where the stated rule differs, such as the window or the credit rule, and each answer names that rule. Fail: the split moves with the wording and no answer says why.
- Hold something out. Switch one channel off in some regions for long enough to count orders, then compare total orders with the regions where it stayed on. Keep the answer that agrees with the holdout. If none does, the prompt was not the problem.
Prompts earn their place in translation: drafting the SQL, then explaining a result you have already reconciled.
Sources, 30 September 2026: CausalVerify (Zhang et al., arXiv, 2026); Spider 2.0 paper (Lei et al., arXiv, 2025); Spider 2.0 leaderboard (XLANG Lab, 2026); Many AI Analysts, One Dataset (Bertran et al., PNAS, 2026; arXiv version); OpenAI text generation guide (OpenAI, 2026); A Comparison of Approaches to Advertising Measurement (Gordon et al., Marketing Science, 2019).
Related answers
Frequently asked questions
Can prompt engineering fix marketing attribution?
Not the causal part. A prompt changes which query a model writes and how it words the verdict, and it cannot add the experiment that shows what a channel caused. Use prompts to draft SQL and to explain numbers you have already reconciled to Shopify.Why does my AI give different attribution answers to the same question?
Model output is non-deterministic, in OpenAI's words, and rewording a question can change the window, the joins and the verdict. Ask five ways on one export, reconcile totals to Shopify, and keep only the numbers that survive.
Go deeper: Incrementality testing, explained.
Sixty-second versions of these ideas: Causality Engine on YouTube Shorts.
Have an audience of ecommerce operators? Earn 20% recurring commission by recommending the €99 read.
Keep reading
Terms in this article
- AnalyticsAnalytics is the systematic computational analysis of data. It reveals customer behavior and measures campaign performance.
- AttributionAttribution identifies user actions that contribute to a desired outcome and assigns value to each. It reveals which marketing touchpoints drive conversions.
- ExperimentsExperiments are scientific procedures that test hypotheses or demonstrate facts. In marketing, experiments like A/B tests determine the causal effect of campaign changes, enabling data-driven decisions.
- Holdout TestA holdout test is an experiment that keeps a random part of an audience from seeing a campaign and compares its results with those of the part that could see it. The held-out part is the control group, so the gap in outcomes estimates what the campaign added.
- IncrementalityIncrementality is the part of an outcome, such as orders or revenue, that a marketing activity caused: the extra results compared with what would have happened without it. It is a causal effect, not the number of conversions credited to a channel.
- Incrementality TestingIncrementality Testing measures the additional impact of a marketing campaign. It compares exposed and control groups to determine causal effect.
- RevenueRevenue is the total income generated by the sale of goods or services related to a company's primary operations.
- ShopifyShopify is an ecommerce platform for creating online stores and selling products. Attribution modeling shows which marketing channels drive traffic and conversions within Shopify.