MarginLab Academy
Lesson 02 · Profit Fundamentals

The Foundation of
Shopify Profitability

Every profit calculation starts with your Cost of Goods Sold. If that number is wrong, every decision that follows is built on unreliable data.

Cost of Goods Sold (COGS) represents the direct cost of the products your store sells. It determines gross margin, influences pricing and affects how accurately you can evaluate products, discounts and advertising performance. This lesson explains what belongs in COGS, what should stay outside it and how to build a reliable cost foundation for your Shopify store.

21 min Focused reading time
COGS Explained step by step
Actionable Built for Shopify merchants
Live cost analysis
Average gross margin
58.4%
Calculated from complete and accurate product costs.
Cost accuracy 96/100
Products with costs Excellent
486
Missing costs Attention
12
Estimated distortion Risk
€4,860
Reading time 21 min read
Difficulty Beginner
ML
Reviewed by MarginLab Research Team
Last updated July 2026
Read this first

COGS explained in 60 seconds.

Cost of Goods Sold is the foundation of every reliable profitability calculation. If your product costs are missing, outdated or incomplete, your margins, pricing decisions and product analysis will all be misleading.

5 core principles
21 min reading time
1 cost framework
01

COGS measures the direct cost of what you sell

It includes the costs directly tied to producing or purchasing the products sold during a specific period, not every expense required to run the business.

02

Accurate COGS is essential for reliable margins

Gross profit and gross margin are calculated from revenue minus COGS. Even a small cost error can make a weak product appear healthier than it really is.

03

Not every product-related expense belongs in COGS

Product purchase costs, manufacturing inputs and certain inbound costs may belong in COGS, while advertising, salaries and general software expenses usually do not.

04

Product costs change over time

Supplier increases, exchange rates, freight charges and packaging changes can make old cost data unreliable. COGS must be reviewed and updated regularly.

05

Missing costs distort every downstream decision

Pricing, discounting, advertising and product prioritization all depend on accurate costs. Without them, Shopify revenue data cannot reveal true profitability.

COGS is not just an accounting number. It is the cost foundation behind every product, margin and profitability decision in your Shopify store.

The foundation of every margin

Every profit calculation starts with COGS.

Revenue tells you how much you sold. Cost of Goods Sold tells you what those sales actually cost. Without accurate COGS, every profitability metric—from gross margin to net profit—becomes unreliable.

Same revenue. Different product costs.

Which store understands its profitability?

Store A Incomplete COGS
Annual revenue $850,000
Reported gross margin 48%
Cost coverage 61%
Products with costs 488
Missing costs 312
Products with complete cost data 61%
VS
Store B Complete COGS
Annual revenue $850,000
Gross margin 34%
Cost coverage 100%
Products with costs 800
Missing costs 0
Products with complete cost data 100%

Store B has lower margins—but better information.

At first glance, Store A appears more profitable. In reality, hundreds of products are missing cost data, making every reported margin unreliable. Store B measures every product accurately, providing a trustworthy foundation for pricing, purchasing and profitability decisions.

Outcome Reliable decisions

Accurate decisions begin with accurate costs.

A higher gross margin means very little if the underlying product costs are incomplete or outdated. Before optimizing pricing, advertising, discounts or product strategy, every Shopify merchant must build an accurate Cost of Goods Sold structure. Reliable COGS is the foundation of every profitability metric you’ll learn throughout this Academy.

What COGS really includes

A product costs more than its supplier price.

The amount shown on a supplier invoice is only the starting point. Freight, customs duties, packaging and other direct costs can materially increase the real cost of every unit sold.

The anatomy of a €40 product

This simplified example shows how a €24 supplier price becomes a €40 unit cost once every direct expense required to make the product saleable is assigned correctly.

01
🏭

Supplier price

The base amount paid to manufacture or purchase one unit.

€24.00
02
🚢

Inbound freight

The unit share of transport from the supplier to your warehouse.

+€5.00
03
🛃

Customs duties

Import duties directly connected to bringing the product into stock.

+€3.00
04
📦

Product packaging

Packaging required to prepare the individual item for sale.

+€2.00
05
🏷️

Direct preparation

Inspection, labeling or assembly performed before the item can be sold.

+€2.00
06
⚠️

Inventory adjustment

A unit allowance for damaged, lost or unsellable inventory.

+€4.00
07

True unit COGS

The complete direct cost assigned to every unit sold.

€40.00
Supplier price €24.00

The visible purchase cost shown on the supplier invoice.

Additional direct costs €16.00

Freight, duties, packaging, preparation and inventory adjustments.

True unit COGS €40.00

The complete product cost that should be used in gross profit calculations.

Hidden cost increase 66.7%

The real cost is significantly higher than the supplier price alone.

Supplier price is not the same as COGS.

Using only the purchase price understates product cost and overstates gross margin. Accurate profitability begins by assigning every direct cost required to bring the product into a saleable condition. The objective is not to add every business expense to COGS, but to capture every direct product cost accurately.

True unit COGS Supplier Price + Freight + Duties + Packaging + Direct Preparation + Inventory Adjustments €40.00 per unit
The hidden cost errors

The 7 COGS mistakes that distort profit.

COGS errors rarely look dramatic inside a Shopify dashboard. They quietly distort product margins, pricing decisions and reported profit until the business begins optimizing numbers that were never accurate.

COGS accuracy scan completed
2 of 7 mistakes analyzed
01
COGS mistake Data Completeness Risk
High risk

Missing Product Costs

When a product has no assigned cost, its revenue may still appear in Shopify while the related COGS remains at zero. This makes gross profit and product margin look significantly stronger than they really are.

Estimated profit distortion €24,600
Products affected 312
Detected cost exposure 88%
MarginLab insight

Products without cost data generated 18% of store revenue during the analyzed period. Their reported margins are unreliable because Shopify recorded the sales but not the cost required to generate them.

Recommended actions

Identify every product and variant that currently has no cost assigned.
Prioritize missing costs on products generating the highest revenue or order volume.
Exclude incomplete products from margin decisions until their costs are verified.
02
COGS mistake Cost Freshness Risk
Medium risk

Outdated Supplier Costs

A product cost can be present and still be wrong. Supplier increases, exchange-rate movements, freight changes and updated purchase terms can make historical costs unreliable even when every product appears complete.

Estimated profit distortion €11,800
Products affected 186
Detected cost staleness 64%
MarginLab insight

Several high-volume products still use costs entered more than six months ago. Recent supplier invoices indicate that their real unit cost has increased, reducing actual margins below the values currently reported.

Recommended actions

Compare stored product costs with the most recent supplier invoices.
Review costs after supplier, freight, duty or currency changes.
Create a recurring cost review for bestselling and low-margin products.
COGS accuracy scan continuing
4 of 7 mistakes analyzed
03
COGS mistake Landed Cost Risk
High risk

Ignoring Inbound Freight

The supplier invoice does not represent the complete cost of bringing inventory into the business. Freight, customs clearance, duties and handling can materially increase the real cost of each unit.

Estimated profit distortion €16,400
Average omitted cost €5.20
Detected landed cost exposure 79%
MarginLab insight

Imported products are currently valued using supplier prices only. Freight and import-related expenses add an estimated 13% to their real unit cost, making reported gross margins materially overstated.

Recommended actions

Allocate freight, duties and import handling costs across received units.
Use landed cost rather than supplier price in product margin calculations.
Review unit costs whenever shipping rates or import charges change.
04
COGS mistake Direct Cost Risk
Medium risk

Excluding Product Preparation

Packaging, labeling, inspection and assembly may look small on an individual unit. When these activities are required to make the product saleable, excluding them understates COGS across every order.

Estimated profit distortion €8,250
Average omitted cost €2.40
Detected preparation exposure 52%
MarginLab insight

More than half of active products require additional packaging or preparation before sale, but those direct costs are not currently included in their stored unit cost.

Recommended actions

Identify packaging and preparation activities required for each product.
Calculate a realistic unit cost for labels, packaging, inspection and assembly.
Separate direct product preparation from general warehouse overhead.

Four cost errors detected. Three remain.

Missing costs, outdated supplier prices, incomplete landed costs and excluded preparation expenses can already make product margins unreliable. The final three mistakes determine whether inventory losses, cost allocation and non-COGS expenses are being treated correctly.

COGS accuracy analysis 4 of 7 complete
Next: inventory losses, cost allocation and expenses that should remain outside COGS.
COGS accuracy analysis

How MarginLab evaluates product cost quality.

Reliable COGS analysis should do more than check whether a cost field contains a number. It should identify incomplete costs, incorrect allocations and expenses that have been classified in the wrong place.

Example Shopify cost analysis

The figures below are a mathematically consistent educational example, not live data from the visitor’s store.

AI
MarginLab intelligence COGS Accuracy Diagnosis
Analysis complete
COGS data health
68 /100
Usable, but unreliable

Most products contain cost data, but inventory losses, broad cost allocation and incorrect expense classification reduce the reliability of reported gross margins.

Products analyzed 800

Active products and variants included in the example.

Cost coverage 94%

Products with at least one stored cost value.

Issues detected 3

Three final COGS risks require merchant attention.

Estimated distortion €21,700

Potential annual gross-profit overstatement.

05 High

Ignoring Inventory Losses

Damaged, missing, expired or unsellable inventory still represents a real product cost. When these losses are ignored, the cost assigned to sold units remains too low and gross profit appears stronger than reality.

Inventory write-offs €9,600
Units affected 428
Margin distortion +1.8 pts
Recommended action

Measure shrinkage, damage and obsolete inventory, then allocate a realistic unit allowance to the products or categories responsible.

06 Medium

Poor Cost Allocation

Freight, duties and preparation costs should not always be divided equally across every unit. Equal allocation can overstate the cost of small products and understate the cost of heavy, valuable or complex items.

Costs allocated equally €34,500
Products misallocated 146
Allocation confidence Medium
Recommended action

Allocate direct costs using the most relevant driver, such as unit quantity, weight, volume, purchase value or preparation time.

07 Critical

Mixing Operating Costs into COGS

Advertising, office software, general salaries and other operating expenses reduce net profit, but they are not normally part of product COGS. Including them in unit cost makes gross margin misleading.

Operating costs in COGS €12,100
Products affected 800
Gross-margin reliability Low
Recommended action

Keep direct product costs inside COGS and classify broader business expenses separately when calculating operating and net profit.

AI

Complete the cost model before trusting the margin.

The store should first account for inventory losses, then improve how shared direct costs are allocated and finally remove operating expenses that do not belong inside product COGS.

First priority Correct cost classification
Educational example

This sample analysis demonstrates how COGS quality can be evaluated using cost completeness, cost freshness, landed costs, inventory adjustments and expense classification. Actual MarginLab recommendations depend on each merchant’s Shopify data and configured cost assumptions.

COGS implementation roadmap

How to build accurate COGS step by step.

Accurate product costs are not created by entering one supplier price and forgetting about it. A reliable COGS system requires complete data, consistent allocation rules, regular updates and a clear separation between direct product costs and operating expenses.

A practical six-step COGS plan

Start with missing product costs, then build a repeatable process for landed costs, direct preparation, inventory adjustments and ongoing cost maintenance.

Cost accuracy roadmap
01

Audit every product and variant

Begin by identifying products with missing, zero or obviously unrealistic costs. Revenue from these products should not be trusted in product-margin analysis until their unit costs have been completed.

Critical priority
Export every active product and variant with its current stored cost.
Flag missing, zero and unusually low cost values for immediate review.
Prioritize products generating the highest revenue and order volume.
Expected impact Very high
Difficulty Low
First review Today
MarginLab can highlight products whose profitability is unreliable because cost data is missing. Find missing costs →
02

Confirm current supplier costs

A completed cost field can still be inaccurate. Compare stored values with current supplier invoices, manufacturing records and purchase terms before using them in pricing or margin decisions.

Critical priority
Compare stored unit costs with the latest supplier or manufacturing documents.
Review products affected by currency movements, quantity changes or new terms.
Record the date and source used for every important cost update.
Expected impact Very high
Difficulty Medium
Review cycle Monthly
Focus first on bestsellers and low-margin products where a small cost error creates the largest distortion. Prioritize by impact →
03

Calculate true landed cost

Add the direct expenses required to bring inventory from the supplier into saleable stock. Depending on the product, this may include inbound freight, customs duties, clearance and handling.

Critical priority
Collect freight, duty, customs and inbound handling costs for each shipment.
Allocate shipment costs using quantity, weight, volume or purchase value.
Add the allocated landed cost to the supplier price of each received unit.
Expected impact Very high
Difficulty High
Review cycle Every shipment
Do not divide every shared cost equally when products differ significantly in weight, value or volume. Improve allocation →
04

Add direct preparation costs

Include packaging, labeling, inspection, assembly and other work required to make an individual product ready for sale. These costs belong in COGS when they can be directly connected to the product.

High priority
List every packaging and preparation activity required before the product is sold.
Calculate the material and direct labor cost attributable to one unit.
Exclude general warehouse expenses that cannot be connected to a specific product.
Expected impact High
Difficulty Medium
First review This week
Small preparation costs can create a large annual distortion when multiplied across thousands of units. Calculate per unit →
05

Account for inventory losses

Damaged, expired, missing and unsellable inventory is part of the economic cost of selling products. Measure these losses and assign a realistic allowance where they occur consistently.

High priority
Track damaged, missing, obsolete and unsellable units separately.
Calculate loss rates by product, supplier or category instead of using one store average.
Update the unit-cost allowance when shrinkage or damage patterns change.
Expected impact Medium
Difficulty Medium
Review cycle Quarterly
Inventory losses should be assigned where they occur rather than hidden inside a generic store-wide estimate. Track loss patterns →
06

Separate COGS from operating expenses

COGS should contain direct product costs. Advertising, software, office expenses and general salaries still reduce profit, but they should normally remain outside COGS so gross margin stays meaningful.

High priority
Keep direct purchasing, manufacturing and preparation costs inside COGS.
Classify marketing, software and general administrative costs separately.
Review the cost model whenever a new expense is added to avoid double counting.
Expected impact High
Difficulty Medium
Review cycle Monthly
Accurate classification preserves the difference between gross profit, operating profit and net profit. Protect margin quality →

COGS accuracy is an ongoing process.

Complete the initial cost model, then review supplier prices, landed costs, preparation expenses and inventory adjustments regularly. Reliable product margins depend on costs remaining current—not merely being entered once.

Cost model readiness 84%
A complete cost audit and a recurring update process create the strongest foundation for reliable Shopify profitability analysis.
Shopify COGS accuracy example

How accurate COGS changed the store’s reported margins.

Incomplete product costs can make an ecommerce store appear more profitable than it really is. This educational example shows how the same revenue and the same orders produce very different reported margins when supplier costs are replaced by a complete COGS model.

Educational case study

The figures below describe a mathematically consistent sample store and do not represent guaranteed MarginLab results.

COGS correction analysis Example Shopify Store
Cost audit completed
Before Cost Audit Incomplete
Reported gross profit €218,400
Revenue €520,000
Reported gross margin 42.0%
Recorded COGS €301,600
Cost model Supplier price only
COGS reliability 43 / 100
After Cost Audit Reliable
Reported gross profit €191,800
Revenue €520,000
Reported gross margin 36.9%
Complete COGS €328,200
Cost model Fully allocated
COGS reliability 94 / 100
COGS adjustment +€26,600

Previously omitted direct costs are now included in every unit sold.

Gross margin change -5.1 pts

The reported margin is lower but now reflects the real economics of the business.

Revenue change €0

The store sold exactly the same products at the same prices.

Decision quality Much higher

Pricing, purchasing and profitability decisions are now based on reliable cost data.

What changed inside the COGS model

The store did not increase sales or raise prices. It simply replaced incomplete product costs with a complete and consistent COGS methodology.

01

Completed supplier costs

Missing purchase prices were added and outdated supplier costs were updated.

+€8,200
02

Allocated landed costs

Freight, duties and import handling were distributed across purchased inventory.

+€9,400
03

Included preparation costs

Packaging, labeling and assembly costs were assigned to each affected product.

+€4,300
04

Recorded inventory losses

Damage, shrinkage and obsolete inventory were incorporated into the cost model.

+€2,900
05

Removed operating expenses

Advertising and administrative costs were excluded from COGS and classified correctly.

Reliable reporting

Accurate COGS does not reduce profit. It removes accounting illusions.

At first glance, the corrected store appears less profitable because gross profit is lower. In reality, nothing became worse. The business always had those costs—they simply were not being measured correctly. Reliable COGS creates reliable gross margins, and reliable gross margins lead to better pricing, purchasing and growth decisions.

Educational outcome Reliable COGS The objective of a cost audit is not to increase reported profit, but to ensure every profitability decision is based on complete and accurate product costs.
Shopify COGS accuracy checklist

Is your Shopify COGS really complete?

Use this checklist to verify whether your product costs reflect the real economic cost of inventory sold. A cost model should not be considered reliable until supplier prices, landed costs, preparation expenses, inventory adjustments and cost classifications are reviewed consistently.

MarginLab Academy Shopify COGS Accuracy Audit
18 COGS checks
01

Supplier cost coverage

Every active variant has a cost

No product or variant should generate revenue without a valid supplier or manufacturing cost.

Zero costs are investigated

A stored value of zero should only remain when the product genuinely has no direct acquisition cost.

High-volume products are prioritized

Missing costs on bestsellers create the largest distortion in store-level gross profit.

02

Cost freshness

Supplier prices reflect recent invoices

Stored costs should match current purchase documents rather than historical estimates.

Currency changes are reviewed

Exchange-rate movements can increase acquisition costs even when the supplier price remains unchanged.

Quantity-based pricing is updated

Different order quantities, minimum purchases and supplier tiers should be reflected in unit costs.

03

Landed cost accuracy

Inbound freight is included

The cost of transporting inventory from the supplier to your warehouse belongs in landed cost.

Duties and clearance are allocated

Customs duties, brokerage and import handling should be distributed across the affected inventory.

Allocation rules match cost drivers

Shared costs should be allocated by quantity, weight, volume or value—not automatically divided equally.

04

Direct product costs

Packaging costs are included

Boxes, protective materials, labels and other product-specific packaging costs should be reflected in the unit cost.

Direct labor is measured

Assembly, inspection, labeling and other preparation work should be included whenever it can be assigned to individual products.

Preparation costs are allocated consistently

Every product requiring additional handling should absorb its own preparation cost using the same allocation methodology.

05

Inventory adjustments

Damaged inventory is recorded

Products that cannot be sold should be reflected in the economic cost of inventory.

Shrinkage is monitored

Missing inventory should be measured and reviewed regularly instead of being ignored.

Obsolete stock is reviewed

Unsellable or expired inventory should not remain valued as fully recoverable stock.

06

Cost classification

Operating expenses stay outside COGS

Advertising, software subscriptions and office expenses should not inflate product costs.

Allocation rules are documented

The business should consistently apply the same methodology whenever shared costs are distributed.

COGS is reviewed regularly

Supplier prices, landed costs and direct product costs should be audited continuously rather than only once.

A reliable margin starts with reliable costs.

If even one part of the cost model is incomplete, every gross margin calculation becomes less reliable. Reviewing supplier prices alone is not enough—every direct cost must be identified, allocated and maintained over time.

Example COGS readiness 68%
Complete all 18 checks before relying on gross margin, pricing or profitability reports.
Every shipment

Review landed costs

Update freight, duties and import costs whenever new inventory arrives.

Monthly

Review supplier prices

Verify purchase costs against current invoices and manufacturing data.

Quarterly

Audit the cost model

Review allocation rules, inventory adjustments and cost classifications to maintain long-term accuracy.

Shopify COGS FAQ

Questions every Shopify merchant should ask about product costs.

These frequently asked questions explain how Cost of Goods Sold works, which costs belong in COGS and which expenses should remain separate. Use them to build more reliable gross margins and avoid decisions based on incomplete product costs.

?
MarginLab knowledge base Shopify COGS Questions
6 expert answers
01 COGS fundamentals What is Cost of Goods Sold? +

Cost of Goods Sold, or COGS, represents the direct cost of the products a business actually sells during a reporting period. For a Shopify merchant, it normally begins with the supplier or manufacturing cost of each product sold.

A reliable COGS figure may also include other direct costs required to bring a product into a sellable condition, such as inbound freight, customs duties, import handling, product-specific packaging and direct preparation work. The exact structure depends on how products are sourced, manufactured and prepared.

COGS is deducted from revenue to calculate gross profit. If product costs are missing, outdated or incomplete, the store may report a gross margin that looks stronger than the business economics really are.

Calculate your COGS →
02 Included costs What should be included in COGS? +

COGS should include costs that are directly connected to acquiring, producing or preparing the specific products sold. The starting point is usually the supplier invoice price or the direct manufacturing cost of each unit.

Depending on the business model, complete product cost may also include inbound freight, customs duties, import taxes that cannot be recovered, customs clearance, product-specific handling, labeling, assembly, inspection and packaging required before the item can be sold.

The key principle is direct attribution. A cost belongs in COGS when it can reasonably be connected to the units sold. When freight, duties or handling apply to several products, the cost should be allocated using a consistent method such as unit quantity, weight, volume or purchase value.

Complete Unit COGS = Supplier Cost + Freight + Duties + Handling + Direct Preparation Costs
Calculate gross margin from complete COGS →
03 Cost classification What should not be included in COGS? +

General operating expenses should not normally be included in COGS when they cannot be directly attributed to acquiring or preparing the products sold. These expenses belong below gross profit in the income statement.

Typical examples include office rent, general software subscriptions, administrative salaries, accounting fees, general marketing expenses, business insurance and other overhead costs. Payment processing fees, outbound shipping and advertising may reduce contribution profit, but they should usually remain separate from product COGS.

Keeping these categories separate makes the financial model easier to understand. Gross margin then measures the relationship between revenue and direct product costs, while contribution and net profit account for the additional expenses required to sell and operate the business.

Compare gross and contribution margin →
04 COGS calculation How do you calculate Cost of Goods Sold? +

At the accounting level, Cost of Goods Sold is calculated by starting with the value of inventory available at the beginning of the reporting period, adding inventory purchases made during the period and subtracting the value of inventory still held at the end.

Beginning Inventory + Inventory Purchases − Ending Inventory = Cost of Goods Sold

For product-level analysis, Shopify merchants should also calculate the complete cost of each unit sold. This usually begins with the supplier or manufacturing cost and adds the allocated share of inbound freight, duties, handling, packaging and direct preparation costs.

The quantity sold must then be multiplied by the complete unit cost. When costs vary between purchase batches, the store should apply a consistent inventory valuation method and avoid replacing historical costs with an unrelated current estimate.

Calculate Cost of Goods Sold →
05 Margin accuracy Why is accurate COGS important? +

Accurate COGS is essential because it determines the reliability of gross profit and gross margin. When product costs are missing or incomplete, the store may appear more profitable than it actually is.

An overstated gross margin can lead to weak pricing decisions, excessive discounts, unprofitable advertising and incorrect assumptions about which products deserve more inventory or promotion. Even small cost omissions can become significant when multiplied across a large number of orders.

Reliable COGS also improves product comparisons. Merchants can identify which products generate healthy gross profit, which products rely on incomplete costs and which high-revenue items contribute less margin than expected.

Correcting COGS does not reduce the store’s real profit. It reveals the profit that was already being generated and removes the accounting illusion created by incomplete product costs.

Analyze product-level profit →
06 Cost maintenance How often should Shopify COGS be updated? +

Shopify product costs should be reviewed whenever a new supplier shipment is received or whenever the purchase price, currency exchange rate, freight charge, customs duty or preparation process changes.

High-volume and high-value products should be checked more frequently because even a small cost error can materially distort reported gross profit. Products with stable domestic pricing may require fewer updates, while imported products with variable freight and currency exposure may need a review for every shipment.

A practical maintenance rhythm is to review landed costs after each shipment, verify supplier prices monthly and complete a broader COGS audit at least once per quarter. Damaged, missing, obsolete or written-off inventory should also be recorded when identified rather than postponed indefinitely.

The objective is not to change costs constantly without evidence. It is to ensure that the cost assigned to each product remains consistent with the real economic cost of acquiring and preparing that product for sale.

Review your gross margin →

Six essential COGS questions answered.

You now have the foundations to classify direct costs, calculate complete COGS and maintain more reliable Shopify gross margins.

6 of 6 complete
Continue learning

Turn accurate product costs into stronger pricing decisions.

You now understand what belongs in Cost of Goods Sold and why complete product costs are essential for reliable margins. Continue with the next lessons to turn accurate COGS into sustainable prices, healthier margins and better profitability decisions.

MarginLab Academy Your Recommended Learning Path
6 next lessons
x