> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Product Margin: Revenue Minus Cost of Goods Sold

> Track product-level profitability by subtracting cost of goods from revenue. Learn the formula, see examples, and optimize your product mix for profit.

<Tip>
  The profit remaining after subtracting cost of goods sold (COGS) from gross revenue.
</Tip>

## Formula

<Info>
  **Product Margin** = [**Gross Revenue**](/reference/metrics/orders/revenue/gross-revenue) − [**COGS**](/reference/metrics/orders/cogs/cogs)
</Info>

### Formula Components

| Metric                                                               | Definition                                                           |
| -------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [**Gross Revenue**](/reference/metrics/orders/revenue/gross-revenue) | Total revenue from order line items before discounts and adjustments |
| [**COGS**](/reference/metrics/orders/cogs/cogs)                      | Cost of goods sold based on product costs in Shopify                 |

| Metadata        |                             |
| --------------- | --------------------------- |
| **Type**        | Currency                    |
| **Data Source** | [Shopify](/sources/shopify) |
| **Aggregation** | Sum                         |

***

## Example

Your store generated **\$85,000** in gross revenue with **\$42,500** in COGS:

| Period   | Gross Revenue | COGS     | Product Margin |
| -------- | ------------- | -------- | -------------- |
| January  | \$85,000      | \$42,500 | \$42,500       |
| February | \$92,000      | \$44,160 | \$47,840       |
| March    | \$78,000      | \$39,780 | \$38,220       |

Product Margin shows how much profit remains from each sale before fulfillment, transaction costs, and marketing expenses are deducted.

***

## How It Works

Product Margin calculates the difference between what you charge customers and what you paid for the products. COGS is pulled from product cost data in Shopify. This metric represents your first layer of profitability before operational costs.

***

## When to Use

| Scenario                         | Action                                                               |
| -------------------------------- | -------------------------------------------------------------------- |
| Evaluating product profitability | Compare margin across product lines or SKUs                          |
| Pricing decisions                | Ensure prices cover costs and target margin                          |
| Supplier negotiations            | Identify products where COGS reduction would have the biggest impact |
| Product mix optimization         | Shift marketing toward higher-margin products                        |

***

## Related Metrics

| Metric                                                                                   | Relationship                                        |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------- |
| [Gross Revenue](/reference/metrics/orders/revenue/gross-revenue)                         | Revenue component in the Product Margin calculation |
| [COGS](/reference/metrics/orders/cogs/cogs)                                              | Cost component subtracted from revenue              |
| [Contribution Margin](/reference/metrics/orders/contribution-margin/contribution-margin) | Product Margin minus additional variable costs      |
| [Net Revenue](/reference/metrics/orders/revenue/net-revenue)                             | Revenue after discounts and refunds                 |

[See all Product Margin metrics →](/reference/metrics/orders/product-margin)
