Attribution & dedup
Before DataGlass can say "this sale came from an ad," something has to decide that. This page explains how that credit is assigned, why the ad sales figure is conservative and trustworthy, the one ad number you should never sum, and how affiliate attribution works (it's exact). The specifics here are for Shopee — other platforms attribute differently.
How an ad gets credit
Shopee uses click-based attribution with a 7-day window: if a shopper clicks your ad and then buys from your shop within 7 days, that purchase is credited to the ad. The credit is recorded on the purchase day and isn't edited retroactively.
There are two flavours:
- Direct — they bought the exact product that was advertised.
- Broad — they bought anything from your shop after clicking (maybe a different product). Broad always includes direct.
DataGlass uses broad for the channel split, so a click that leads to any purchase still counts as ad-driven.
Why ad sales (baht) are trustworthy
The natural worry: if a shopper clicks two of your ads before buying, is that sale counted twice?
For sales value (GMV), no. Shopee splits the sale across the campaigns the shopper touched — the pieces add back up to one sale at most, never more. So the total ad-attributed sales figure is conservative by construction: it sits below your actual sales, never inflated.
The one number never to add up: ad order counts
Ad order counts are the exception. If a shopper clicked three of your ads and then bought once, that single purchase is counted as an order for all three ads.
So summing "orders" across campaigns overcounts — sometimes by ~3× on a busy promo day. And it can't be perfectly de-duplicated, because the raw data only summarises orders per campaign; it doesn't link an individual order back to one specific campaign.
That's why DataGlass leans on ad sales (baht) — not ad order counts — everywhere it matters: the profit flow, the Sankey, and True ROAS. When you see an ad order count, read it as "ad-influenced touches," not distinct orders.
Stripping cancelled orders (deduplication)
Shopee's raw ad numbers include orders that were later cancelled — which would credit ads for sales that never became money. DataGlass removes that.
The catch: the data never says which cancelled order came from which ad (the same reason ad order counts can't be de-duped). So instead of matching them one-to-one, DataGlass estimates the ad's share proportionally, one campaign and one hour at a time:
- Gather the pool. Take every order in that hour that contained an advertised item — the orders the campaign could plausibly have driven.
- Measure the ad's share. Work out how much of that pool's volume the ad actually claimed: ad-attributed quantity ÷ total quantity placed. Say it comes to 30%.
- Apply it to the cancellations. Assume the ad was responsible for that same 30% of the cancelled volume in the hour, and subtract that from the ad's credit.
Working hour-by-hour stops a busy promo hour from smearing into a quiet one. Two safety rails: it never subtracts more than the ad was credited in the first place, and the cleaned figure never drops below zero. The result is cleaned ad sales — the figure that lines up with actual settled money.
Affiliate attribution (different, and exact)
Affiliate sales aren't estimated at all. An order counts as affiliate when it carries an affiliate (AMS) commission line in Shopee's settlement — meaning Shopee literally charged you a commission for an affiliate on that order.
Because that's a hard line in the money record, affiliate attribution is exact, not modelled. The commission you paid shows up as its own cost bucket.
How the three channels fit together
The channels are carved in order, so they always add back up to your sales:
- Affiliate first — exact, from the commission line.
- Ads next — attributed and cleaned, and capped so affiliate + ads can never exceed your total sales.
- Organic last — whatever's left: free reach.
This ordering is why the Revenue by channel split on your shop overview always reconciles to GMV. For how those channels appear on the dashboard, see Understanding the numbers.
Why this is accurate
None of this is a black box. Each piece is sound for a concrete reason:
- Affiliate is a fact, not a model. It's read straight from a commission Shopee actually charged you. If the commission line exists, an affiliate was involved — there's nothing to estimate or get wrong.
- Ad sales can't be inflated. Shopee partitions a sale across the campaigns a shopper touched, so the pieces sum to one sale at most. The math has no way to manufacture revenue that didn't happen. When we checked the ad-attributed sales against the actual settled money for the same orders — on the same price basis, with cancellations aligned — the ad figure came out below real sales, not above. That's the opposite of double-counting.
- The dedup can't overshoot. The cancelled orders are always a subset of the volume already in the pool, so the ad's share applied to them is bounded by what the ad was credited in the first place. On top of that, we cap the subtraction at the raw ad figure and floor the result at zero. The worst case is that it strips a little too much (under-crediting ads), never too little.
- The estimate can't move your totals. The one estimated step — splitting credit between ads and organic — only decides which channel a sale is filed under. It never changes total sales or total profit: the channels always add back up to GMV, and channel profits always sum to your bottom line. So even if a borderline sale lands in "organic" instead of "ads," your profit is unaffected.
In short: the parts that can be facts are facts (affiliate, settled money), the one part that must be estimated (ad vs. organic split) is built to err on the safe side and is fenced in so it can't distort your headline numbers.