TL;DR
- Gross margin by product line is line revenue minus direct cost of goods sold, divided by line revenue — reported per SKU or per product family, not company-wide.
- Line COGS includes unit cost, inbound freight, duties, and packaging. It excludes ad spend, salaries, and overhead.
- The blended gross margin on the P&L hides which lines are pulling their weight and which are leaking. Ranking by line is the fix.
- Track weekly in a five-column view: product line, revenue, gross margin %, WoW trend, status (scale / hold / watch / review / cut).
- Improve it with four levers in order: price, mix, COGS, SKU count. Fairview calculates gross margin by line automatically once Shopify or Stripe and QuickBooks or Xero are connected.
Gross margin by product line is the profit each product or product family generates after its direct cost of goods sold. It is the number that tells you which lines deserve more inventory, more promotion, and more shelf space — and which ones are silently dragging the blended margin down.
Most operators read the blended gross margin on the monthly P&L and call it done. That number is an average. It cannot tell you that your top line is running 58% while a long-tail add-on is burning through working capital at 9%. The line-level view can.
This spoke gives you the formula, the COGS rules, the weekly tracker, benchmarks by business model, and the four levers that actually move line margin. It pairs with the broader profit leak detection framework and the contribution margin by channel view.
What is gross margin by product line?
Definition
Gross margin by product line: the percentage of line revenue that remains after subtracting the direct cost of producing and delivering that line. Calculated per SKU or per product family, it answers which parts of the catalog make the business money and which parts consume it.
A “product line” can be a single SKU, a family (PRO, CORE, LITE), a bundle, or a pricing plan. Pick the grain that matches how you make decisions. If you reorder inventory at the family level, track at the family level. If you kill SKUs individually, track at the SKU level.
Two numbers come out: a dollar figure (gross profit the line produced) and a percent (how efficient each revenue dollar is). Rank lines by both. High dollars and high percent means scale. High dollars but slipping percent means diagnose. Low dollars at any percent means review or cut.
Gross margin vs contribution margin vs operating margin
Three margin numbers, three different decisions. Mixing them up is the single most common mistake in product profitability analysis.
| Metric | What it subtracts | Best used for |
|---|---|---|
| Gross margin | Direct COGS only | Product-line, SKU, and pricing decisions |
| Contribution margin | COGS + ad spend + fees + fulfillment | Channel, campaign, segment decisions |
| Operating margin | All variable + fixed overhead | Board reporting, fundraising |
Key insight
Gross margin by product line tells you whether a product should exist. Contribution margin by channel tells you where to promote it.
The formula, line by line
Formula:
Gross margin (%) = Gross profit ($) ÷ Line revenue
Worked example from the diagram above:
- Line revenue (1,240 units × $298): $369,520
- Unit COGS ($118) × 1,240 units: $146,320
- Inbound freight + packaging allocation: $8,200
- Gross profit: $215,000
- Gross margin: 58.2%
The arithmetic is one subtraction and one division. The hard part is defining which costs belong in COGS for each line, and pulling them cleanly. That is the next section.
Which costs belong in line COGS
Per the FASB ASC 330 inventory guidance, COGS is the direct cost of acquiring or producing the goods sold, plus costs to bring inventory to its present location and condition. Four buckets belong. Three common offenders do not.
Include: unit cost
The price you pay a supplier per unit, or the internal build cost per unit for manufactured lines. Pull it from the inventory record in Shopify, QuickBooks, or Xero. Update it whenever a new PO lands at a different price — stale unit costs are the most common source of wrong gross margin.
Include: inbound freight and duties
Ocean freight, airfreight, customs duties, and any broker fees on imported lines. Allocate by unit count or by weight, not by revenue. For DTC brands sourcing overseas, this bucket alone can swing a line from 42% margin to 31% when freight rates spike.
Include: packaging and direct labor
Boxes, inserts, dunnage, and any labor tied to picking/packing the specific line. For services or SaaS, include the hosting, seat-level infrastructure, and any per-seat third-party API costs that scale with usage.
Exclude: ad spend, salaries, overhead
Advertising belongs in contribution margin. Sales salaries, rent, and general overhead belong in operating margin. Pulling them into gross margin inflates COGS and makes every product line look worse than it is, which leads to cutting winners.
How to allocate shared costs honestly
Shared costs — freight containers carrying multiple SKUs, a 3PL fee that covers several lines, a shared label printer — are the messy middle. Three rules keep the allocation defensible:
- Allocate by a physical driver, not revenue. Freight allocates by weight or volume. 3PL by units picked. Labor by minutes. Allocating by revenue circulates the problem: high-price lines absorb more cost and look worse than they are.
- Document the driver once, keep it stable. Switching allocation methods mid-year breaks your trend line. Pick a driver, publish the rule, and only revisit it on an annual basis.
- Reconcile to the GL monthly. The sum of allocated line COGS should match the company-level COGS on the ledger within 1–2%. If it does not, you have double-counted a cost or missed a bucket.
How to track gross margin by line weekly
Build the tracker with five columns: product line, line revenue, gross margin %, week-over-week trend, and status. Populate it every Monday before the ops review. Sort the table by margin percent, not revenue — the bottom of the list is where the decisions live.
Assign a status based on margin and trend:
- SCALE — margin above target, trend up. Add inventory, more promotion.
- HOLD — margin near target, trend flat. Keep velocity, monitor weekly.
- WATCH — margin near target, trend down. Review freight, supplier, discount depth.
- REVIEW — margin below target or trend down sharply. Diagnose this week: price, mix, or cost.
- CUT — margin under 10% for two or more weeks with no path back. Stop promoting, clear stock, sunset.
What is a good gross margin by product line?
Benchmarks vary by business model and category. These are directional, not universal:
| Business model | Healthy line gross margin | Review threshold |
|---|---|---|
| B2B SaaS | 70–85% | <60% |
| DTC commerce | 40–60% | <30% |
| B2B services | 40–55% | <25% |
| Hardware / electronics | 25–40% | <15% |
| Food & beverage (CPG) | 35–50% | <25% |
A commerce brand with a 52% hero-SKU and a 28% long-tail add-on is normal. A commerce brand where the long-tail add-on has fallen from 38% to 9% over three months and still has full marketing support is paying to move inventory that does not pay back. The blended P&L margin hides both.
Four levers to improve gross margin on a line
When a product line falls below its target, operators reach for four levers. Work them in this order:
- Price. Raise list, trim promotional depth, or add a higher-tier variant. A 3% list-price lift on a 40% margin line, with no volume loss, adds ~1.8 points to gross margin. Price is the fastest lever, and usually the most under-used.
- Mix. Push volume toward higher-margin variants within the line. If PRO runs at 58% and LITE at 28%, shifting 10% of sessions from LITE to PRO lifts blended margin by ~3 points without touching either SKU’s price.
- COGS. Renegotiate with suppliers quarterly, consolidate freight, eliminate packaging waste, requalify materials. This is slow — typically 60–90 days to see it land — but the most durable.
- SKU count. Cut long-tail SKUs that drag the average. A Harvard Business Review analysis of CPG catalogs found that cutting the bottom 20% of SKUs by margin typically lifts blended gross margin 2–4 points and cuts working capital tied up in inventory by 10–15%.
How Fairview calculates gross margin by line automatically
Fairview pulls revenue and unit-level sales from Shopify and Stripe, unit COGS and freight from QuickBooks or Xero, and computes gross margin per product line on a daily cadence. No spreadsheet rebuild, no SQL, no stale exports.
When a line’s margin drifts past the threshold you set, Fairview writes a named next-best action into the Monday operating report — the same cadence covered in the profit leak detection framework. Every action carries an estimated weekly dollar impact so the team knows what to prioritize.
First connection takes under 10 minutes. See pricing and tiers or the Margin Intelligence product page for a closer look.
Per-SKU
Margin granularity
Daily
Line margin refresh
3–7pp
Typical blended margin lift in 90 days
Key takeaways
- Gross margin by product line is the single number that governs pricing, mix, and SKU decisions.
- Include unit cost, freight, duties, packaging, and direct labor. Exclude ad spend, salaries, overhead.
- Allocate shared costs by a physical driver, not revenue. Publish the rule and hold it steady.
- Track weekly. A five-column view with a status flag catches margin drift inside seven days.
- Improve in this order: price, mix, COGS, SKU count. Small moves compound fast.
Rank every product line by real margin this week.
Connect Shopify or Stripe and QuickBooks or Xero. Fairview returns your first line-level margin view on day one. 14-day trial, no card required.
Frequently asked questions
Take the revenue from a product line, subtract its direct cost of goods sold (unit COGS multiplied by units sold, plus inbound freight and packaging), and divide the result by line revenue. The output is a percentage that shows how profitable the line is before operating costs. Run the calculation for every SKU or product family on the same cadence, then rank by gross profit dollars and gross margin percent.
DTC commerce lines typically run 40 to 60% gross margin, B2B SaaS lines 70 to 85%, B2B services 40 to 55%, and hardware 25 to 40%. Anything 10 or more points below the category norm deserves a review. The absolute number matters less than the trend: a line drifting 2 points down per month has a fixable problem whether it starts at 55% or 30%.
Gross margin subtracts only cost of goods sold from revenue. Contribution margin goes further and subtracts every variable cost the revenue triggered, including ad spend, processing fees, and fulfillment. Gross margin is the right view for product-line and pricing decisions; contribution margin is the right view for channel and campaign decisions.
Unit cost of the product, inbound freight, duties, packaging, and any direct labor tied to producing or picking the line. Exclude advertising, sales salaries, and general overhead — those belong in contribution margin or operating margin. Pulling ad spend or salaries into line COGS inflates cost and makes healthy lines look like losers, which leads to cutting winners.
Weekly for commerce and seasonal lines, monthly at minimum for B2B SaaS. Freight, supplier pricing, and promotional discounts all move on a weekly cadence, so monthly review lets a two-point margin slip hide for a full quarter before anyone catches it. Operators who track gross margin by line every Monday catch drift within seven days, before it compounds into a full-quarter leak.
Work four levers in order: price (raise list or reduce discount depth), mix (push more volume to higher-margin variants), COGS (renegotiate suppliers, reduce freight, eliminate waste), and SKU count (cut long-tail SKUs that distort the average). A one to two percentage-point move on each lever compounds into a ten-point margin lift within a quarter. See how line margin feeds into the CAC payback period for the downstream effect.