Campaign Revenue Report
How many sales a campaign was attributed and how much they were worth.
Attribution means the customer redeemed balance from the campaign (cashback,
point, coupon), or received a message from it and bought within the attribution
window (notification). Sales the campaign merely rewarded are not counted — the reward
is a consequence of the sale, not its cause.
This lives in the order service because the sale value does. The loyalty campaign report measures the benefit (credited, redeemed, outstanding balance); this one measures the revenue. They answer different questions and will not match.
byOrigin does not add up to total, by design. A sale attributed through more than
one origin counts once in each. total counts distinct orders, so it is always less than
or equal to the sum of byOrigin.
Attribution is not incrementality. These sales may have happened anyway — the customer had balance and used it, but might have bought regardless. Read this as influenced revenue, not generated. Measuring real impact requires a control group.
Cancelled orders are excluded — revenue from a reverted sale is not revenue.
All monetary values are integers in cents, in the organization's currency. revenueGross
is the order total before the redeemed balance is taken out; revenueNet subtracts it
and is what came in as money. avgDiscount is redeemed / revenueGross (a ratio),
averageTicketGross is revenueGross / orders and averageTicketNet is
revenueNet / orders, all over distinct orders; the gap between the two tickets is the
average balance applied per order.
baseline is the ruler: orders not attributed to this campaign, in the same window and
organization. Without it an absolute revenue figure always looks good. It is cached (the
query is expensive and the value moves slowly), so it carries its own computedAt and is
not from the same instant as the rest of the payload.
When no period is given, the window runs from the first to the last attributed order —
comparing against all-time would fill the baseline with periods when the campaign did not
exist. period.explicit tells which of the two happened.
The date range is all-or-nothing. Informing only one of the two returns 404 — the route
itself does not match with a single date. Half a window silently ignored would return
all-time numbers wearing the requested period's face.
Try-it values populated from environment ACME (Demo)
Authentication
Token
Send your user token in the x-guper-authorization header.