Revenue is a vanity number. Compute real Shopify margin from cost, discounts, refunds, shipping and fees, and find the orders losing you money.
Open your Shopify admin on any given morning and the first thing you see is revenue. It is a satisfying number. It goes up during a sale, it spikes on launch day, and it is the figure you quote when a friend asks how the store is doing.
But revenue has a dangerous quality: it looks the same whether you made money or lost it. A 1,000 order day at a 40 percent margin and a 1,000 order day at a 2 percent margin produce the identical top-line. One pays your rent. The other quietly drains your bank account while your dashboard celebrates.
This is the core problem with running a store on revenue alone. Revenue hides money-losing orders. It hides the product that sells like crazy but barely clears the cost of its own packaging. It hides the discount code that tripled volume and halved your take-home. By the time the damage shows up in your bank balance, it has been compounding for weeks.
The fix is not complicated, but it does require a shift: stop asking *how much did we sell* and start asking *how much did we keep*. That second question is what this post is about. We will walk through exactly what you need to turn Shopify revenue into real margin, where the money leaks between the two, and how to see margin by product, by order, and by channel so the losers stop hiding behind the winners.
If you are still setting up the basics, our guide to tracking the Shopify KPIs that actually matter is a good companion to this one.
Between the price a customer pays and the money you actually keep, there is a stack of deductions. Most store owners can name two or three of them. The ones who run profitably can name all of them and track each one.
Here is the full stack you have to subtract from gross sales to get to real margin:
- Cost of goods sold (COGS) — what you paid for the item itself. This is the big one, and the one most owners estimate rather than measure.
- Discounts — every promo code, automatic discount, and sale price that lowered the amount actually charged.
- Refunds and returns — money that left after it arrived, plus any restocking or return-shipping cost. Returns are sneaky because the original order still counts as revenue.
- Shipping cost — what you paid the carrier, which is often more than what you charged the customer.
- Payment processing fees — the percentage your processor takes on every transaction.
- Taxes — collected on behalf of the government, never yours to keep.
The trap is that revenue dashboards show you the top of this stack and your bank account shows you the bottom, with nothing connecting the two. So you *feel* the squeeze at month-end without being able to point to where it came from.
A useful mental model: gross revenue minus discounts, refunds and taxes gives you net revenue. Net revenue minus COGS gives you gross margin. Gross margin minus shipping and payment fees gives you something close to contribution margin — the money each sale actually contributes toward your fixed costs and profit. That last number is the one that tells you whether an order was worth fulfilling.
If you have ever stared at two tools showing two different sales figures and wondered which to trust, the same deduction stack is usually why. We dig into that specific headache in why your numbers never match across tools.
Here is the honest, load-bearing prerequisite for everything else in this post. You cannot compute margin without cost. No tool can. If the cost of an item is not recorded anywhere, the best any analytics platform can do is show you revenue with the costs missing, which is just revenue wearing a disguise.
The good news is that Shopify already has a place for this. On each product variant there is a Cost per item field. When you fill it in, Shopify stores your per-unit cost alongside the price, and that cost can flow through to the order data. That single field is the difference between a margin report and a guess.
If your Cost per item fields are blank, that is the highest-leverage afternoon of work you can do for your store's finances. A few practical notes:
- Use landed cost where you can. The truest COGS includes what you paid the supplier plus inbound freight and duties divided across the units. Even an approximate landed cost beats unit price alone.
- Bulk-edit it. Shopify lets you edit Cost per item in bulk from the product list, and you can export to a sheet, fill costs in columns, and re-import. You do not have to touch products one at a time.
- Keep it current. When a supplier raises prices or your freight changes, the cost field goes stale. A quarterly review keeps your margin numbers honest.
What about costs that do not live in Shopify, like ad spend? Be clear-eyed here. VedaX connects to Shopify and the marketplaces directly, but it does not plug into ad platforms. There is no direct Google Ads or Meta connector. If you want to fold advertising into your profitability picture, you bring that spend in yourself by exporting it to a Google Sheet or CSV and connecting that. VedaX computes from the data you connect or upload, it does not invent costs that were never recorded. We cover the workaround for marketing costs in marketing attribution without the spreadsheet headache.
The principle to hold onto: margin analysis is only as good as the cost data behind it. Get the Cost per item field populated first, and everything downstream becomes possible.
Once your costs are in place, the mechanics are straightforward. Connecting your Shopify store to VedaX is a read-only link — VedaX reads your orders, line items, and products, and never writes anything back to your store. Your data stays your data.
From there, the order and product data carries everything margin needs: the price charged, the discount applied, the Cost per item for each line, the refund records, and the payment details. When cost data is present, margin is computable — VedaX can subtract the deduction stack from the next section and show you what you actually kept, not just what you sold.
The fastest way to start is to ask in plain English. Open VedaX Buddy and type something like *what was my gross margin last month* or *show net margin by product for the last 90 days*. Buddy writes the SQL against your connected data, runs it, and returns a chart or table. You do not write a query, and you do not export anything to a spreadsheet to do the math by hand.
A few VedaX features make margin specifically easier to trust:
- Semantic column roles. VedaX classifies each column in your data as a metric, dimension, identifier, or date, so it knows that cost and price are numbers to compute on while order ID is just a label. If it ever mislabels one of your columns, you correct it and your correction sticks.
- Data Explorer. You can browse and profile your order and product tables directly, filter to a date range or a product, visualize the result, and save the view so it is one click away next time.
- Dashboards with scheduled reports. Pin your margin charts to a dashboard and set it to email you on a recurring schedule, so your real profit picture lands in your inbox without you logging in. For a deeper build, see our walkthrough of a live profit-and-loss dashboard.
The point is not the SQL or the charts. It is that the deductions revenue hides become visible, in your own data, in a few minutes.
A single store-wide margin number is a start, but it is also an average, and averages lie. A healthy 35 percent blended margin can easily contain a hero product running at 60 percent and a popular dud running at 4 percent. The blend looks fine while one product slowly eats the gains of another. To act, you need margin broken down three ways.
Margin by product. This is where the surprises live. Sort your products by margin, lowest first, and you will usually find a few high-volume items clustered near the bottom. These are the dangerous ones — they sell well, so they feel like winners, but each unit barely clears its cost. Ask Buddy for *gross margin by product, worst first* and look hard at anything below your store average that also has high order volume. Some of those deserve a price increase, a cheaper supplier, or a quiet retirement. Deciding which is exactly the question we tackle in which products to stop selling.
Margin by order. Product-level margin assumes every sale of an item is equally profitable, but it is not. The same product sold with a 30 percent discount code, shipped across the country at a loss, and partially refunded can flip from profitable to underwater. Looking at margin per order surfaces the patterns: orders under a certain basket size that lose money after shipping, or a discount tier that turns winners into losers. This connects directly to two sibling topics — whether your promotions actually pay off, covered in discount and promo ROI, and how returns silently erode the bottom line, covered in refunds and returns analytics.
Margin by channel. If you sell through more than one route — online store, a marketplace, wholesale — each has its own fee structure and discounting behavior, so each has its own margin. A channel that drives impressive revenue can be your least profitable once its fees come out. Breaking margin down by channel tells you where to push and where to pull back.
The move in all three cases is the same: stop looking at the blended average, break it apart, and let the losers reveal themselves.
Running a margin report once is useful. The trouble is that margin does not sit still. A supplier raises prices, a popular product drifts onto permanent discount, shipping rates climb, and your real margin erodes a point at a time without any single dramatic event to alert you. Manual reports only catch this if you happen to run them on the right week.
This is where VedaX shifts from a tool you query to a system that watches. The Insights feed is proactive — it surfaces findings without you asking. It flags trends when a metric like gross margin moves against the prior period, anomalies when something spikes or drops unexpectedly, and goals when a target you set drifts off track. Every finding comes with an *Ask Buddy* button to dig in and a *View data* button to see the rows behind it.
The most valuable of these for profit is contribution analysis — when your margin moves, the natural next question is *which product, channel, or discount drove it*. Instead of you slicing the data by hand to find the culprit, VedaX points at the segment responsible. We explain the technique in detail in contribution analysis: what actually drove the change, and the broader philosophy in proactive analytics that find you instead of waiting to be asked.
To close the loop, turn on the Insight Digest — an opt-in email that delivers your insights to whoever you choose, daily or weekly, at an exact time in your workspace timezone. It is off by default, so you switch it on deliberately and pick the cadence. Now the margin question you used to forget to ask answers itself and lands in your inbox. Here is how to set up and tune the analytics email digest.
Start simple. Populate Cost per item, connect Shopify, ask Buddy for margin by product, and look for the high-volume losers. Then let the Insights feed and digest keep watch so the next slow leak does not get a head start on you.
It can, but only when cost data is present. Margin is revenue minus your costs, so the calculation depends on having a per-item cost recorded. Shopify provides a Cost per item field on each product variant — once that is filled in, VedaX reads your connected order and product data and can compute gross and net margin for you. If the cost fields are blank, no tool can produce a true margin, because the cost simply is not in the data. Populate Cost per item first, then ask VedaX Buddy for margin by product or by order.
In Shopify, open a product, go to a variant, and fill in the Cost per item field. You can do this in bulk from the product list or by exporting to a spreadsheet, adding costs in a column, and re-importing. For the most accurate margin, use landed cost — supplier price plus inbound freight and duties per unit — rather than just the unit price. Keep it updated when supplier or freight costs change, otherwise your margin numbers slowly drift out of date.
Not through a direct connection. VedaX connects to Shopify and the marketplaces directly, but it has no Google Ads or Meta Ads connector. To fold advertising into your profit picture, export your ad spend to a Google Sheet or CSV and connect that to VedaX. The platform computes from the data you connect or upload — it will not invent ad costs that were never recorded. This is a deliberate honesty point: margin that includes ad spend requires you to bring that spend in.
Gross margin is revenue minus the cost of goods sold — what you paid for the products themselves. Net margin goes further and subtracts the other deductions: discounts, refunds, shipping cost, payment processing fees, and taxes. Gross margin tells you whether your products are priced above their cost. Net margin, sometimes approximated as contribution margin, tells you what each sale actually contributes after all the leaks. For decisions about which products and orders are truly worth it, net or contribution margin is the number to trust.
No. The Shopify connection is strictly read-only. VedaX reads your orders, line items, and products to run analysis, and never writes anything back to your store or your database. Your data stays yours, and nothing in your Shopify admin is modified by connecting or by running margin reports.
See it in VedaX: Shopify and marketplace analytics in VedaX