Home / E-commerce
For e-commerce operators

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.

Try it on sample store data → No signup, no app install on your store.

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.

MetricDefinitionWhat it is for
Net sales
also called net revenue
gross sales − discounts − refundsOne 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 profitgross sales − discounts − COGSProfit before marketing, on the pre-refund revenue base. Needs unit cost on your variants.
Contribution margingross sales − discounts − COGS − ad spend − refundsWhether 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

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.

Ask the sample store → Then upload one month of your own exports and check it against a figure you already trust.

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

Questions

Does Quiriz connect to Shopify directly?
No. It reads the exports Shopify, your ad platforms and your accounting tool already produce — no app on the store, nothing to authorise. Your numbers are as current as your last export, which suits a weekly or monthly margin review rather than a live dashboard.
What is contribution margin, exactly?
Gross sales minus discounts, COGS, ad spend and refunds. It excludes overhead and fixed costs, so it is not net profit — it answers whether a category pays for itself once advertising and returns are taken out.
How is ad spend attributed to a product category?
By the mix of orders attributed to each campaign. Spend that matches no order is reported as an explicit Unallocated row, so you can see how much of your advertising is untraceable instead of having it spread evenly across categories.
Do I need unit costs for this to work?
For gross profit and contribution margin, yes — unit cost on your variants is what makes COGS computable. Net sales (net revenue) works without it.
Can it break results down by acquisition channel?
Yes. Channel joined product category as a governed breakdown in August 2026, reading the source tag recorded on each order. Orders that arrived with no source tag are reported as an explicit Unallocated row, the same way untraceable ad spend is — under a contribution-margin breakdown by channel, both land in that one row.