Which products actually make money after discounts, returns and ad spend?
Revenue by product is easy. Margin by product is where stores get it wrong — because the discounts sit on the order, the refunds arrive weeks later, and the ad spend was never attached to a product at all. Quiriz subtracts all three the same way every month.
Most store owners can tell you their top seller by revenue and cannot tell you whether it is profitable. The gap is not effort — it is that four costs live in four exports at three different grains, and stitching them together by hand produces a different answer each time you do it.
This is built for stores past the point where a spreadsheet holds, and before the point where someone has been hired to own the numbers.
The metrics come pre-defined
Every formula, so you can check it against how you already measure before uploading anything.
| Metric | Definition | What it is for |
|---|---|---|
| Net sales also called net revenue | gross sales − discounts − refunds | One metric, two names. Revenue after discounts and returns, excluding shipping and tax — the same breakdown Shopify reports. Ask for either name and you get this figure. |
| Gross profit | gross sales − discounts − COGS | Profit before marketing, on the pre-refund revenue base. Needs unit cost on your variants. |
| Contribution margin | gross sales − discounts − COGS − ad spend − refunds | Whether a category pays for itself once advertising and returns are taken out. |
Net sales and net revenue are the same number here, and asking for either returns it. The two terms are used interchangeably for a store selling its own goods: both take gross sales, subtract discounts and returns, and leave out shipping and sales tax. (The one place they part company is marketplace reporting, where "net revenue" can mean commission earned rather than the value of goods sold — not what a store selling its own inventory is measuring.)
Gross profit is deliberately taken before refunds. A refund gives back the revenue, but most returns come back into stock — and this data carries no way to reverse the cost of the goods that returned with them. Subtracting the refund while still carrying its full COGS would understate the margin by counting the cost of something you got back. Contribution margin subtracts refunds, because by then the question is whether the category paid for itself.
Contribution margin is not net profit, and the page will not pretend otherwise. It excludes overhead and fixed costs. It is commonly called “net profit by category” in store dashboards, which is where a lot of confident, wrong decisions start.
The part everyone gets wrong
An order-level discount does not belong to a product until you decide how to split it. A refund arrives after the sale. Ad spend belongs to a campaign, not a category. Three different grains, three chances to double-count.
Discounts recorded on the order are split across its lines by each line's share of revenue — so a category that carried more of the order absorbs more of the discount.
Refunds are attributed to the categories of the order being refunded, and counted in that order's period — not the period the money moved.
Ad spend is split across categories by the mix of orders attributed to each campaign. Spend that matches no order is reported as Unallocated rather than quietly spread across everything.
Broken out by channel, that same Unallocated row carries one more thing: orders that arrived with no source tag. Two kinds of unknown, one label — deliberately, because two labels for the same idea reads as two separate problems.
That last word is the point. A tool that silently spreads unattributed spend gives you a tidy table where every category looks slightly worse than it is, and no way to see how much of the number was a guess. An explicit Unallocated row tells you how much of your advertising you cannot yet trace — usually the most useful number on the page.
The exports it reads
- Shopify — orders and line items, products and variants (with unit cost, for COGS), and refunds.
- Ad platforms — Google and Facebook spend by campaign, plus whatever attribution export links campaigns to orders.
- Anything else at order grain — 3PL fees, marketplace settlements, a spreadsheet of landed costs.
Exports, not a live connection. There is no app to install on your store and nothing to authorise. The trade is honest: your numbers are as current as your last export, so this suits the weekly or monthly margin review, not a live sales ticker.
What it breaks down by
Governed answers break down by product category and by acquisition channel, over any window you ask for. That is still a short list on purpose — a breakdown is only published here once it is implemented end to end, because a “by channel” answer that quietly returns categories is worse than no answer at all.
Channel reads the source tag on the order, so orders that arrived without one are reported as Unallocated rather than assigned to a best guess.
What it will not answer
Inventory turns is not a governed answer, and neither is sell-through or days on hand. All three need average inventory over the period, which is a balance rather than something you can add up — a month of stock levels does not sum to a year of stock. A tool that adds them anyway returns a number every time and is quietly wrong every time.
Ask Quiriz for inventory turns and it will say it cannot, name the two definitions people mean by it, and ask which you want — rather than picking one silently. That is the trade for the reproducibility below: definitions that are stored can also be refused.
Why the number holds still
Ask a chat assistant for margin by product twice and you will get two numbers, because it re-decides each time whether shipping counts, whether refunds belong to the sale month, and what to do with unattributed ad spend. Quiriz routes the question to a stored definition that compiles to SQL, so the same question returns the same figure — and every answer states whether it came from those definitions or was answered freehand.
Pricing
You pay for workspaces and the people who build them — not for everyone who asks a question. Your VA checking margin on a SKU costs nothing. See pricing →
Your files stay yours, and we do not train on your data. Privacy policy →
Related reading
- Contribution margin by product category — the metric this page is built on, and the four allocation choices underneath it
- Net sales vs gross sales in Shopify — why three reports give three answers
- Gross margin by SKU from a Shopify export — the cost data nobody has
- Attributing refunds to the right month — the choice that changes every monthly series
- Joining Shopify and ad exports — the step every margin metric assumes
- Why inventory turnover is not in your dashboard — the boundary, stated plainly
- How to calculate ROAS by channel
- Agentic AI in e-commerce
- All guides →