Attribution for online shops: models, windows and incrementality
TL;DR
Difficulty: Advanced
Attribution shares the credit for orders that happened. Incrementality measures which orders a channel caused. Use the first to understand journeys and the second to set budgets.
- GA4 and Google Ads now offer only data driven and last click. Compute first click, linear and time decay yourself from your own visit data if you want them.
- Every platform counts inside its own windows and dates, so their claims overlap and their sum overstates the shop. Write the window next to every number.
- Measure cause with a random holdout on your customer list or a geo test, read in your own order data, and decide on the interval, not the point.
- Turn each test into an incrementality factor that calibrates the platform claims, and add a marketing mix model once you have two years of weekly data.
What to read first
Google Ads, Meta and your newsletter tool all claim the same order, and the sum of their claims is far larger than your shop. This chapter separates the two questions hiding in "which channel made the sale": how the credit is shared, and what a channel actually causes. It works both through on one invented homeware shop in Limerick, with SQL, Python and two real tests.
Which channel made the sale? Usually several, and sometimes none
A customer sees an Instagram ad for a linen tablecloth, clicks it, looks, and leaves. Nine days later she searches for a lamp and lands on your shop through an ordinary Google result. Six days later your newsletter arrives, and she clicks through to the sale. The next day she types your brand name into Google, clicks the paid ad at the top, and buys. Four channels touched one order. Which one made the sale?
Every tool you own will answer that question, and they will answer it differently. Google Ads will say the brand search ad did it. Your email tool will say the newsletter did it. Meta may well say the Instagram ad did it. Each of them is reporting something true about its own part of the journey, and the sum of their claims is far larger than the orders in your shop.
This chapter answers the question properly, in two halves. The first half is attribution: the rules that share the credit for an order between the touchpoints on its path. Attribution is bookkeeping. It tells you how journeys look. The second half is incrementality: whether a channel caused sales that would not have happened without it. Incrementality is cause and effect, and it is the only thing that should move a budget. The two are often confused, and that confusion is the most expensive mistake in shop marketing.
It is the last chapter of the series and builds on when analytics, ads and orders disagree, which explains why the systems count different totals.
Example: one order at Shannonside Home, four claims
Shannonside Home is the invented homeware shop in Limerick that runs through this series (shannonsidehome.example). Niamh owns it, Callum builds and runs the shop software. The example's baseline numbers: 110,000 sessions a month, a conversion rate of 1.8%, so 1,980 orders, an average order value of €84, a gross margin of 52% on product, and an ad spend of €16,500 a month, of which €10,600 goes to Google Ads and €5,900 to Meta. Callum runs that money as five lines: brand search €1,750, non brand Google Shopping €6,500, non brand Google search €2,350, Meta prospecting to new people €2,850 and Meta retargeting to past customers €3,050.
The order from the opening paragraph is real in the example's world: €112, a tablecloth and a lamp. Here is who claims it:
| System | What it reports | Why |
|---|---|---|
| Google Ads | 1 conversion, €112 | the last ad click before the purchase was a brand search ad |
| Meta | 0 or 1 conversion, €112 | the ad click was 16 days earlier, so it counts only if she also saw a Shannonside ad in the last day |
| Email tool | 1 conversion, €112 | a newsletter click the day before |
| GA4, data driven | a fraction of the order per channel | a model shares the one order between the touchpoints |
| The shop | 1 order, €112 | the only system that counts money |
Look at the Meta row closely, because it already shows how windows decide credit. Meta's default setting counts a purchase within seven days of an ad click, or within one day of an ad view.1 The click on day 0 is 16 days before the purchase, so it is outside the window. If she happened to scroll past another Shannonside ad the evening before she bought, Meta claims the order anyway, as a view through conversion. Three or four systems can claim one €112 order, and none of them is lying. They are answering different questions.
What attribution can answer, and what it cannot
Attribution answers a descriptive question: on the paths that ended in an order, which channels appeared, and in what order? It shows which channels open journeys and which close them, and how long people take to decide.
Attribution cannot answer the causal question: how many of these orders would not have happened without this channel? A path only records what happened. It never records what would have happened if one touchpoint had been missing. The customer who clicked the brand search ad was typing your name. She was coming anyway. The ad sat in her path, and it gets credit, but removing it might have changed nothing at all.
So use attribution to understand journeys, and use incrementality to decide budgets. The rest of this chapter follows that split.
Example: Niamh's budget question
Niamh asks Callum: "Should I move €2,000 a month from Meta to Google?" Callum opens the attribution report built from the shop's own visit data. Under last click, paid search earns a return on ad spend (ROAS, revenue divided by ad spend) of , and Meta . Under first click the order flips: Meta reaches and paid search drops to . (The order counts come from the four model table further down.)
Neither report answers Niamh's question. Her question is about the next €2,000, and what it would cause. The attribution report is about the last month's orders, and how to share them out. Callum writes the question down as an incrementality question, which the second half of this chapter answers, and he uses attribution only to describe the journeys.
What an attribution model actually sees
An attribution model in GA4, or in your own database, works on paths: the list of sessions one browser had before it bought, each labelled with a channel. The channel comes from the UTM parameters on the link, from the Google Ads click identifier, or from the referring site. If your UTM tagging is messy, every model inherits the mess. UTM tracking for your online campaigns covers the tagging itself.
Three gaps shape every path:
- Consent. A visitor who declines analytics cookies has no stored browser identifier, so their visits cannot be linked into a path. Their orders still happen. They are just missing from the path data.
- Devices. Someone who clicks an ad on the phone and buys on the laptop leaves two separate paths, unless they log in on both.
- Views and offline touches. A path holds visits to your site. An ad that was seen but not clicked, a podcast, a friend's recommendation and a parcel insert are invisible. Private sharing alone is a large blind spot, described in dark social.
GA4 adds one rule of its own. All its attribution models exclude direct visits from credit, unless the path consists only of direct visits.2 So in GA4, the customer who typed your address as her last step does not give credit to "Direct". The credit goes to the last channel before it.
Example: how many Shannonside orders have a path at all
In one month Shannonside's shop records 1,980 orders. Callum's own visit records, which only link visits for browsers that accepted analytics cookies, hold a usable path for 1,540 of them. That is , so about 78% of orders have a path, and 22% have none. Every attribution figure in this chapter is a share of those 1,540 orders, not of all 1,980. The ratio is an ordinary proportion, explained in Foundations: ratios and rates. Callum adds a line to every attribution report: "Based on 1,540 of 1,980 orders (78%)." That one line stops anyone treating the credited numbers as the whole shop.
Rule based models: five ways to share one order
A rule based model shares the credit by a fixed rule that someone chose. Five are common:
- Last click: the last channel before the purchase gets everything.
- First click: the first channel gets everything.
- Linear: every touchpoint gets an equal share.
- Position based: the first and last get 40% each, and the touchpoints in between share the remaining 20%.
- Time decay: touchpoints closer to the purchase get more, and the weight halves every so many days.
Time decay is the only one that needs a formula. Each touchpoint gets a raw weight, and the shares are the raw weights divided by their sum:
where is the raw weight of touchpoint , is the number of days between touchpoint and the purchase, is the half life in days (after days a touchpoint counts half as much), is the number of touchpoints on the path, and is the share of the credit touchpoint receives. The halving is exponential decay, covered in Foundations: logarithms, and dividing by the sum turns weights into shares, as in Foundations: percentages.
None of these rules is right. Each one encodes an opinion about which touch matters, so the honest habit is to look at more than one.
Example: the €112 order under five rules
The path from the opening, with the number of days before the purchase:
- Paid social (Instagram ad click), 16 days before.
- Organic search, 7 days before.
- Email (newsletter click), 1 day before.
- Paid search (brand ad click), on the day.
Last click: paid search gets €112.
First click: paid social gets €112.
Linear: four touchpoints, so each gets .
Position based: paid social gets 40%, so . Paid search gets 40%, also €44.80. The two in the middle share 20%, so 10% each: organic search €11.20 and email €11.20. Check: .
Time decay with a half life of seven days. The raw weights:
where each is the raw weight from the formula above, with set to that touchpoint's days before the purchase and . Their sum is . Divide each weight by 2.6108 and multiply by €112:
| Touchpoint | Weight | Share | Credit |
|---|---|---|---|
| Paid social | 0.2051 | 7.9% | €8.80 |
| Organic search | 0.5000 | 19.2% | €21.45 |
| 0.9057 | 34.7% | €38.85 | |
| Paid search | 1.0000 | 38.3% | €42.90 |
| Total | 2.6108 | 100% | €112.00 |
The same order gives paid social anything from €0 to €112, depending only on the rule. Nothing about the customer changed.
The same month under four models
One order is a curiosity. A month of orders shows the pattern. When Callum runs the four models over all 1,540 paths, the totals per model are identical, because every model shares out the same orders. What moves is the split between channels.
Example: Shannonside's 1,540 orders, credited four ways
Callum computes the credit from the shop's own visit records (the SQL is further down). Each column sums to 1,540:
| Channel | Last click | First click | Linear | Time decay |
|---|---|---|---|---|
| Paid search | 430 | 380 | 410 | 425 |
| Paid social | 150 | 390 | 260 | 200 |
| Organic search | 360 | 420 | 390 | 370 |
| 270 | 90 | 180 | 235 | |
| Direct | 230 | 160 | 200 | 215 |
| Other | 100 | 100 | 100 | 95 |
| Total | 1,540 | 1,540 | 1,540 | 1,540 |
Two channels swing hard. Paid social goes from 150 orders under last click to 390 under first click, a factor of . Email goes the other way, from 270 to 90. The reading is not that one model is right. The reading is about roles: at Shannonside, Meta opens journeys and email closes them, and paid search sits steadily in the middle and at the end. That is useful for planning creative and timing. It still says nothing about what any channel causes.
Data driven attribution in GA4 and Google Ads
Today GA4 offers three models in its attribution settings: data driven, paid and organic last click, and Google paid channels last click. First click, linear, time decay and position based were removed from GA4 in November 2023.2 Google Ads followed the same path: it supports last click and data driven, and conversion actions that used the retired rule based models were upgraded to data driven.3 So if you want the four rule based views from the previous section, you compute them yourself from your own data. GA4 will not show them any more.
Data driven attribution learns the shares from your own account's data instead of using a fixed rule. Google describes it as machine learning that evaluates both converting and non converting paths, with a counterfactual approach that compares what happened with what could have happened, and gives credit by how much each touchpoint changes the likelihood of a key event.2 Two details matter in practice. Credit can be reattributed for up to seven days after the conversion, so last week's channel numbers can still move.2 And GA4's attribution settings say which channels may receive credit at all: Google paid channels only, or paid and organic.4
Google does not publish the full algorithm. The textbook version of the counterfactual idea is the Shapley value from cooperative game theory, which Lloyd Shapley described in 1951.5 It asks: if channels joined the journey in every possible order, how much would each one add on average? The formula for two channels is short enough to work by hand:
where is the credit channel receives, is the conversion rate of visitors exposed to exactly the set of channels , is the conversion rate with neither channel, and the two halves are 's added value when it comes first and when it comes second. It is an average of two possible outcomes, the idea behind Foundations: expected value.
Example: sharing credit between Meta and Google, the Shapley way
This is an illustration of the idea, with invented rates, not Google's own computation. Among Shannonside's visitors in one month:
- Neither channel touched them: conversion rate 0.5%.
- Only Meta: 1.0%.
- Only Google Ads: 2.0%.
- Both: 3.6%.
Meta's added value when it comes first is points. When it comes second, after Google: points. Its Shapley credit is the average:
where is Meta's credit in percentage points of conversion rate. Google's added value: first, points; second, after Meta, points. So
with the same kind of credit for Google Ads. The two credits add up to the full gap between exposed to both and exposed to neither: . As shares, Meta gets and Google .
Now the catch. Those conversion rates come from people who were exposed, and exposure is not random. Google's brand ads are shown to people already searching for Shannonside, who were likely to buy anyway. Meta's retargeting is shown to people who already visited. So "exposed to Google" partly means "already keen", and the Shapley shares inherit that bias. A large study of 15 advertising experiments at Facebook found that observational methods, even with rich data, often failed to recover the effect that the randomised experiments measured.6 The deeper reason is covered in causal inference in marketing. Data driven attribution is a better description than a fixed rule. It is still a description.
Lookback windows and dates decide what gets counted
A lookback window, also called a conversion window, is how far back from a purchase a system looks for touchpoints that may take credit. A click outside the window simply does not exist for that system.
The defaults differ, and they are worth writing down:
| System | Setting | Default | Options |
|---|---|---|---|
| GA4 | Acquisition key events (first visit, first open) | 30 days | 7 or 30 days4 |
| GA4 | All other key events, including purchase | 90 days | 30, 60 or 90 days4 |
| Google Ads | Click through | 30 days | 1 to 90 days, depending on the source7 |
| Google Ads | View through | 1 day | 1 to 30 days7 |
| Google Ads | Engaged view (video) | 3 days | 1 to 30 days7 |
| Meta | Attribution setting | 7 day click, 1 day view | the API offers 1, 7 and 28 day click, 1 day view and 1 day engaged view1 |
Meta also stopped returning the 7 day view and 28 day view windows through its reporting API from 12 January 2026.8 If an old report of yours used them, its numbers cannot be reproduced today.
Dates add a second trap. Google Ads has always reported conversions on the date of the ad click, not the date of the purchase. Newer "by conversion time" columns show them on the day they actually happened.9 Your shop counts orders on the day they were placed. So a click on 28 February and a purchase on 3 March is a February conversion in Google Ads' standard columns and a March order in your shop. The previous chapter, when analytics, ads and orders disagree, works through this gap in reconciliation. For attribution, the rule is simpler: never compare channels measured with different windows, and always say the window next to the number.
Example: shortening the window at Shannonside
Niamh reads that "most people decide within a month" and asks Callum to shorten GA4's purchase window from 90 to 30 days. Callum checks the paths first. Of the 1,540 paths, 210 have their first touch more than 30 days before the purchase. In 160 of those, the old first touch was paid social: someone clicked an Instagram ad in spring and bought a sideboard five weeks later.
With a 30 day window, those 160 first touches fall out. Under first click, paid social drops from 390 orders to . Nothing changed in the shop. The window cut off the start of the slowest journeys, and the slowest journeys at a homeware shop are the furniture ones, with the biggest baskets. Callum keeps 90 days and adds the window to the report title.
Every platform marks its own homework
Each advertising platform reports the conversions it can link to its own ads, inside its own windows, counted its own way. It does not deduct the orders another platform also claims, because it cannot see them. So the claims overlap, and their sum regularly exceeds the shop's real orders.
So add up the platforms' claims every month, put the sum next to your real order count, and treat each platform's ROAS as an input to its bidding, never as its worth.
Example: Shannonside's month of claims
In the same month, the systems report:
- Google Ads: 1,000 conversions.
- Meta: 600 conversions, of which 190 are one day view through.
- The newsletter tool: 380 conversions (it counts a purchase after any email click within its own window).
Their sum is orders. The shop also holds 1,980 orders in total, from every channel including organic search and direct. When Callum matches each order against the click identifiers stored with it, only 1,150 distinct orders had any paid ad touch at all, and GA4's data driven model credits the three channels with 860 of the 1,540 orders it can see. The ROAS, POAS and MER chapter works through that deduplication step by step.
The three tools together claim of the shop: every single order, as if organic search, direct visits and referrals brought in nothing. Google and Meta alone claim orders, while only 1,150 orders had a paid touch, so claims are double counted. Both figures are credit, and neither is cause. Callum's monthly report now shows the platform sum next to the order count.
The brand search trap
The clearest case of credit without cause is the ad on your own name. When someone searches "Shannonside Home", your organic result is usually first anyway. A paid ad above it collects the click, and with it a very high ROAS, because the people searching your name were going to buy at a high rate.
eBay tested exactly this. In large field experiments it switched off brand keyword ads on two search engines, and found no measurable short term benefit from them. For non brand keywords, the ads mostly reached frequent users who would have bought anyway, and the average return was negative.10 One fair caveat: a shop whose competitors bid on its name can lose the top spot when it stops, so the answer for a small shop can differ. That is exactly why it is a question to test, not to assume.
There is a quick calculation that tells you how much of a campaign's claim must be real for it to pay. Call it the break even incrementality:
where is the share of the claimed conversions that must be truly incremental for the campaign to cover its cost, is the campaign's spend, is the number of conversions the platform claims, and is the gross margin earned per order. It is a ratio of cost to claimed profit, see Foundations: ratios and rates. The fuller margin per order, after delivery, payment fees and returns, is worked out in unit economics per order. Using that fuller margin makes the test stricter.
Example: Shannonside's brand campaign
Shannonside spends €1,750 a month on its brand search campaign. Google Ads claims 200 conversions, worth , a ROAS of . On paper it looks grand, the best money in the account.
The gross margin per order is . So . Only 20% of the claimed conversions, about 40 orders, need to be truly caused by the ad for it to break even on gross margin. That is a fair hurdle, and the eBay result says it is not a safe one. Callum does not switch the campaign off on a hunch. He puts it on the list of things to test, which is where the second half of this chapter starts.
Incrementality: the only number that should move a budget
Incrementality is the share of a channel's sales that would not have happened without it. You measure it by comparing two groups that differ only in whether they got the channel: a test group that receives it and a control group that does not. Because the groups are split at random, any difference in sales between them is caused by the channel.
Three numbers come out of a test:
where is the conversion rate in the test group, is the conversion rate in the control group, is the difference between them (the lift in percentage points), is the number of people in the test group, is the number of incremental orders, is the average order value, is what the channel cost during the test, and iROAS is the incremental return on ad spend. These are differences and ratios of rates, covered in Foundations: ratios and rates.
One more number connects the test back to the daily reports. The incrementality factor is the measured incremental orders divided by the orders the platform claimed for the same people and period:
where is the incrementality factor, the incremental orders from the test and the conversions the platform claimed, one more ratio from Foundations: ratios and rates. Multiply a platform's future claims by and you get a calibrated figure you can budget with, until the next test.
Randomised tests in advertising are noisy, and it is better to know that before you run one. Lewis and Rao analysed 25 large field experiments with retailers and brokerages and found that the median confidence interval on the return on investment was more than 100 percentage points wide.11 Individual purchases vary so much that a modest ad effect drowns in the noise unless the test is large or long. Plan for that, or the test will tell you nothing.
Google and Meta also run randomised lift studies inside their own systems, for accounts that qualify. Five ways to prove a campaign actually worked describes what each offers. Below are the two tests a shop can run on its own, at any size, and read in its own orders.
Holdout tests on your own customer list
The simplest incrementality test a shop can run uses its own customers. You split the list at random, show the ads to one part, hold the other part back, and count orders in your own shop database. No platform report is needed to read the result. Five ways to prove a campaign actually worked shows the same design on an email list. Here it runs on a paid social audience, which is where shops most often overpay for credit.
The split must be random and stable: the same customer lands in the same group every time, and nobody chooses who goes where. A hash of the customer number does that without a lookup table:
require "digest"
module Holdout
# Same customer, same group, every time, with no table to keep
def self.control?(customer_id, test:, percent:)
Digest::SHA256.hexdigest("#{test}:#{customer_id}").to_i(16) % 100 < percent
end
end
# Example: everyone who lands in the 10% control is left out of the audience upload
Holdout.control?(48_213, test: "meta-customers-2027q2", percent: 10)
The test name goes into the hash, so each new test reshuffles the groups. Callum keeps the control customers out of the audience file that goes to Meta, and leaves everything else in the shop the same for both groups: same newsletter, same prices, same website.
Then he measures the difference and its uncertainty. The confidence interval for a difference of two rates:
where is the difference in conversion rates, and are the two groups' rates, and their sizes, and 1.96 is the multiplier for a 95% interval. Foundations: confidence intervals explains where the 1.96 comes from, and Foundations: sample size why small groups give wide intervals. In Python, the whole calculation is six lines:
from math import sqrt
def lift_interval(orders_t, n_t, orders_c, n_c, z=1.96):
r_t, r_c = orders_t / n_t, orders_c / n_c
diff = r_t - r_c
se = sqrt(r_t * (1 - r_t) / n_t + r_c * (1 - r_c) / n_c)
return round(diff, 4), round(diff - z * se, 4), round(diff + z * se, 4)
print(lift_interval(1296, 21600, 132, 2400)) # (0.005, -0.0047, 0.0147)
Example: Meta ads to past customers, tested twice
The retargeting line is a Meta campaign to past customers who agreed to marketing: 24,000 people. Over four weeks it costs €2,820, and Meta claims 380 purchases for it.
First test: four weeks, 10% held back. The test group has 21,600 customers, the control 2,400. In the shop database, 1,296 test customers ordered (6.0%) and 132 control customers ordered (5.5%).
- The lift: , half a percentage point.
- Incremental orders: .
- The standard error: .
- The 95% interval: , so from to .
The interval runs from minus 0.47 points to plus 1.47 points. It includes zero. In orders, the effect could be anything from about to . The point estimate of 108 looks precise, and it is not. This is the Lewis and Rao problem in miniature: the control group of 2,400 is too small for an effect of half a point.
Second test: twelve weeks, 20% held back. Callum doubles the control share and triples the length. Test group 19,200, control 4,800. Over twelve weeks, 3,072 test customers ordered (16.0%) and 696 control customers ordered (14.5%). Meta claimed 1,150 purchases for the campaign over the period, which cost €8,450.
- .
- incremental orders.
- Standard error: .
- 95% interval: , from to . It excludes zero.
- Incremental revenue: . iROAS: .
- Incremental gross margin: , against €8,450 of spend. The campaign pays.
- Incrementality factor: .
So the campaign works, and Meta's own report claims four times what it causes. Both statements are true at once. From now on, Callum multiplies Meta's claims for this campaign by 0.25 in the budget sheet, and keeps letting Meta optimise on its own numbers.
Geo experiments: switching a channel off in some places
Some channels cannot be held back from a list. You cannot keep a random 10% of the country away from Google Shopping. You can, though, keep some regions away from it. A geo experiment assigns non overlapping regions at random to test or control, which is how Google's researchers described the design in 2011.12 An online shop is well placed to run one, because every order carries a delivery Eircode.
The analysis builds a counterfactual: what the test regions would have sold without the change. Google's time based regression method predicts that counterfactual series from the control regions, using the weeks before the test to learn the relationship.13 Meta publishes GeoLift, an open source R package for the same job, based on synthetic control methods, which build the counterfactual from a weighted blend of control regions.14 Both are worth using once you run tests regularly. The simplest version, which shows the logic, is a ratio:
where is the predicted revenue of the test regions in week , is the actual revenue of the control regions in week , is the ratio between the two groups learned in the weeks before the test, and the sums run over the pre test weeks only. The effect is the gap between and the actual test revenue during the test. Indexing one series to another is covered in Foundations: indexing and base rates.
A test that switches spend off is called a go dark test. It answers the question "what do we lose without it?", which is the right question for a channel you already pay for. It also saves money while it runs.
Example: switching off non brand Shopping ads in a quarter of the country
Callum groups Eircode routing keys (the first three characters of an Eircode) into matched pairs with similar revenue and trend over the previous year, and a random draw sends one of each pair to the test group. The test regions carry about 23% of Shannonside's revenue. For four weeks, Shannonside's non brand Google Shopping campaign excludes the test regions. Everything else stays the same everywhere.
Revenue by week, in euro:
| Week | Control regions | Test regions | Predicted test | Gap |
|---|---|---|---|---|
| Pre 1 | 29,200 | 8,600 | 8,760 | |
| Pre 2 | 28,500 | 8,760 | 8,550 | |
| Pre 3 | 30,500 | 9,330 | 9,150 | |
| Pre 4 | 29,900 | 8,840 | 8,970 | |
| Pre 5 | 29,000 | 8,560 | 8,700 | |
| Pre 6 | 30,200 | 9,210 | 9,060 | |
| Pre 7 | 29,500 | 8,760 | 8,850 | |
| Pre 8 | 29,500 | 8,830 | 8,850 | |
| Test 1 | 30,000 | 6,900 | 9,000 | 2,100 |
| Test 2 | 30,700 | 7,110 | 9,210 | 2,100 |
| Test 3 | 29,800 | 6,880 | 8,940 | 2,060 |
| Test 4 | 30,500 | 7,050 | 9,150 | 2,100 |
- The ratio from the eight pre weeks: control revenue sums to €236,300 and test revenue to €70,890, so .
- Predicted test revenue in each test week is times the control revenue that week, for example .
- Predicted test revenue over the four test weeks: . Actual: .
- Revenue lost without the ads: .
- Spend saved in the test regions: €340 a week (the campaign costs €6,500 a month nationally), so €1,360 over four weeks.
- iROAS: . Incremental gross margin: , which is €2,987.20 more than the €1,360 spent.
- Google Ads claims a ROAS of 7.24 for this campaign (560 conversions a month), which in these regions would be over four weeks. The incrementality factor: .
How sure is the €8,360? In the pre weeks the prediction missed by between €20 and €210 a week, with a standard deviation of about €156. Over four weeks that is roughly of noise, so a rough 95% range for the loss is , about €7,750 to €8,970. Even at the low end, of gross margin is far above the €1,360 spent. This rough range ignores the uncertainty in itself, which time based regression and GeoLift handle properly, so the true range is wider still. See Foundations: spread for the standard deviation.
The decision follows from the range, not the point. Non brand Shopping clearly pays, and Google's report claims only about 18% more than it causes, since . That is a far better ratio than the retargeting line on Meta, and it makes sense: generic Shopping ads reach people who were not already on their way to Shannonside. Callum keeps the campaign. Whether it should get more money is a question about the next pound, not the average one, which allocating an eCommerce ad budget answers.
Marketing mix modelling, the third leg
Attribution describes journeys, and tests measure one channel at one moment. A marketing mix model (MMM) looks at all channels at once over years of weekly data, and estimates how much each one adds, including the ones with no clicks at all, such as print, podcasts or a sponsorship. It needs no cookies, because its input is one row per week. The price is resolution and history: it works at channel level, and it needs about two years of weekly data to say anything firm.
The best setup uses all three together. Tests give clean, causal numbers for single channels. The model spreads that knowledge across all channels and spend levels, and the tests keep the model honest. Media mix modelling, adstock and where the next pound goes explains the model in depth. How to turn the results into a budget, channel by channel, is the subject of allocating an eCommerce ad budget.
Example: when Shannonside is ready for a model
Shannonside has 14 months of clean weekly data: spend per channel, orders, revenue, promotions and bank holidays. Meta and Google spend rose together over the year, so a model could not yet tell them apart. Callum keeps the weekly table growing and runs one test a quarter. In ten months there will be two years of history and a second round of line by line tests to calibrate a model with. That is the moment to build it.
Computing first and last touch from your own data
GA4 no longer shows first click or linear, and its paths only cover consented browsers anyway. If the shop records its own visits, you can compute every rule based model yourself, and check GA4 against it. In a Rails shop, a common way is the Ahoy gem, which stores visits in your own database and can link an order to the visit that placed it through an ahoy_visit_id column on the orders table.15 Callum adds that column to Solidus's spree_orders table. Each visit carries a visitor_token, so all earlier visits by the same browser can be found.
The query below shares each March order between the channels on its 30 day path, under first touch, last touch and linear. It runs on PostgreSQL:
WITH touches AS (
SELECT o.id AS order_id,
CASE
WHEN v.landing_page LIKE '%gclid=%' THEN 'Paid search'
WHEN v.utm_medium IN ('cpc', 'shopping') THEN 'Paid search'
WHEN v.utm_medium = 'paid_social' THEN 'Paid social'
WHEN v.utm_medium = 'email' THEN 'Email'
WHEN v.referring_domain ~ '(google|bing|duckduckgo)\.' THEN 'Organic search'
WHEN v.referring_domain IS NULL THEN 'Direct'
ELSE 'Other'
END AS channel,
ROW_NUMBER() OVER (PARTITION BY o.id ORDER BY v.started_at) AS pos_first,
ROW_NUMBER() OVER (PARTITION BY o.id ORDER BY v.started_at DESC) AS pos_last,
COUNT(*) OVER (PARTITION BY o.id) AS n_touches
FROM spree_orders o
JOIN ahoy_visits buyer ON buyer.id = o.ahoy_visit_id
JOIN ahoy_visits v ON v.visitor_token = buyer.visitor_token
WHERE o.completed_at >= '2027-03-01' AND o.completed_at < '2027-04-01'
AND v.started_at <= o.completed_at
AND v.started_at > o.completed_at - INTERVAL '30 days'
)
SELECT channel,
SUM(CASE WHEN pos_first = 1 THEN 1 ELSE 0 END) AS first_touch,
SUM(CASE WHEN pos_last = 1 THEN 1 ELSE 0 END) AS last_touch,
ROUND(SUM(1.0 / n_touches), 1) AS linear
FROM touches
GROUP BY channel
ORDER BY last_touch DESC;
The CASE block turns each visit into a channel, and every report depends on it, so keep it in one place. The joins find the visit that placed the order, then every visit by the same browser. The window functions number each order's visits from both ends and count them. The WHERE clause is the 30 day lookback window written in code. The final SELECT counts first and last touches per channel and gives each visit of an order for the linear model.
Two differences from GA4 remain. This query gives direct visits credit, which GA4 does not. To match GA4, drop direct visits from every path that also holds another channel. And the browser token only exists where the visitor accepted the cookie, or where the law allows it without consent, which is the next section.
Example: checking GA4 against the shop
Callum runs the query for March and compares its last touch column with GA4's paid and organic last click report for the same month. Paid search: 430 in his query, 452 in GA4. The gap of 22 orders is close to the number of March paths that ended on a direct visit after a paid search click, which GA4 hands to paid search and his query hands to direct. With that one rule aligned, the two agree within a handful of orders. Now he trusts both, and he can compute first click and linear, which GA4 no longer offers.
Consent and the law decide what attribution can see
Path data needs an identifier stored in the visitor's browser, and storing or reading one is regulated. This is general information, not legal advice.
In Ireland, Regulation 5(3) of the ePrivacy Regulations, S.I. No. 336 of 2011, allows storing information on a user's device, or reading it, only with consent based on clear and comprehensive information that names the purposes.16 The exceptions cover only what is needed to carry a communication or what is strictly necessary for a service the user asked for. Irish law has no exception for statistics, so even a self hosted visit log that sets a cookie needs consent here, and advertising pixels certainly do. The Data Protection Commission (DPC) enforces these rules.
Uploading a customer list to an advertising platform, as in the holdout example, is processing of personal data and needs a lawful basis under Article 6 of the GDPR.17 That is why the Shannonside example only uses customers who agreed to marketing. The rest of the consent picture, including what may run before a visitor decides, is in the first chapter of this series and in event tracking and consent mode.
Incrementality tests have one quiet advantage here. A geo test needs nothing but orders by Eircode routing key, which the shop holds anyway to deliver them. It measures the effect of advertising without following anyone.
Example: what consent does to Shannonside's paths
Shannonside's 1,540 paths out of 1,980 orders reflect declined consent and cross device journeys together. Niamh asks whether a pushier cookie banner would raise the share. Callum talks her out of it: under Article 4(11) of the GDPR, consent only counts if it is freely given,17 and a banner that steers people towards yes puts exactly that at risk. So the 22% without a path stay dark. He works out what that costs the attribution report: orders, or of revenue a month with no path. For the budget question it makes no difference, because the geo test counted those orders by Eircode routing key, cookie or no cookie.
A practical attribution stack for a shop this size
Here is the setup that fits a shop like Shannonside, with around 2,000 orders and €16,500 of ad spend a month. Each question gets the tool that can actually answer it:
| Question | Tool | How often |
|---|---|---|
| How much did we really sell? | Shop orders, net of refunds | Daily |
| What do journeys look like, which channels open and close? | GA4 data driven next to your own first, last and linear | Monthly |
| What should each platform bid on? | The platform's own conversions, sent from the server | Continuous |
| Does a channel cause sales, and how many? | Customer list holdout or geo test | One test a quarter |
| How do the platforms' claims translate into real orders? | Incrementality factor from the latest test | After every test |
| How should the whole budget be split? | Marketing mix model, calibrated with the tests | Yearly, once two years of data exist |
The flow below turns the table into a decision: which method fits the question in front of you.
Example: Shannonside's budget sheet, every line tested
The two tests above cover the retargeting line and non brand Shopping. Callum ran the same kind of geo test on the other three lines: brand search, non brand search and Meta prospecting, which has no list to split. His monthly budget sheet now has the incremental figure next to each platform claim.
| Line | Spend a month | Platform claims | Factor | Incremental orders | Cost per incremental order |
|---|---|---|---|---|---|
| Brand search | €1,750 | 200 | 0.25 | 50 | €35.00 |
| Google Shopping, non brand | €6,500 | 560 | 0.85 | 475 | €13.68 |
| Google search, non brand | €2,350 | 240 | 0.83 | 200 | €11.75 |
| Meta prospecting | €2,850 | 185 | 0.49 | 91 | €31.32 |
| Meta retargeting, past customers | €3,050 | 415 | 0.25 | 104 | €29.33 |
| All five | €16,500 | 1,600 | 0.58 | 920 | €17.93 |
Each factor is incremental orders divided by the claim, for example , and the cost per incremental order is spend divided by incremental orders, for example . Google's three lines add up to incremental orders of the 1,000 it claims, and Meta's two lines to of 600.
Against the gross margin of €43.68 per order, every line pays. Against the contribution per order of €22.44, which also pays for delivery, payment fees and returns (worked out in the ROAS, POAS and MER chapter), only the two non brand Google lines earn. Brand search passes the gross margin hurdle of 40 orders from the brand section but not the contribution hurdle of about 78 orders, and both Meta lines cost more per incremental order than an order contributes. So Niamh's question, whether to move €2,000 from Meta to Google, has a sharper answer than either attribution report gave: the money to move is in retargeting and brand search, not in Meta as a whole. Where it goes next is a question of marginal returns, the subject of allocating an eCommerce ad budget.
Conclusion
Attribution and incrementality answer different questions. Attribution shares the credit for orders that happened, by a rule or a model, and it is the right tool for understanding journeys: which channels open them, which close them, how long people take. It is the wrong tool for budgets, because every path records what happened and never what would have happened without a channel.
GA4 now offers data driven and last click only, Google Ads the same, and every platform counts within its own windows and dates, so the platforms' claims overlap and their sum overstates the shop. Write down every window, compute the rule based views yourself from your own visit data if you want them, and always put the platforms' sum next to the real order count.
Incrementality is measured, not modelled: a random holdout on your own customer list, or a geo test that switches a channel off in some regions, read in your own order data. Expect noise, size the test for it, and decide on the interval, not the point. Then carry the result into daily work as an incrementality factor, and add a marketing mix model once you have two years of weekly history. That is the series in one line: count orders in the shop, describe with attribution, and decide with experiments.