> ## 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.

# CM4 (Operating Profit): Profit After All Costs

> Track CM4 Operating Profit for your Shopify store. Calculate true operating profit after all costs including OPEX.

<Tip>
  CM4 (Operating Profit) measures your true operating profit after deducting all costs—COGS, fulfillment, marketing, agency fees, and operating expenses.
</Tip>

## Formula

<Info>
  **CM4** = **CM3** − **Agency Fees** − **OPEX** − **Other Costs**
</Info>

### Formula Components

| Metric                                                                                             | Definition                                    |
| -------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| [**CM3 (Contribution Margin)**](/reference/metrics/orders/contribution-margin/contribution-margin) | Profit after marketing and ad spend           |
| **Agency Fees**                                                                                    | Fees paid to marketing agencies               |
| **OPEX**                                                                                           | Operating expenses (salaries, rent, software) |
| **Other Costs**                                                                                    | Additional fixed or semi-fixed costs          |

| Metadata        |                                                                      |
| --------------- | -------------------------------------------------------------------- |
| **Type**        | Currency                                                             |
| **Data Source** | [Shopify](/sources/shopify), [Upstack Costs](/sources/upstack-costs) |
| **Aggregation** | Sum                                                                  |

***

## Example

Your Shopify store has **\$42,500** CM3, with **\$5,000** in agency fees, **\$15,000** OPEX, and **\$2,500** other costs.

| Component   | Amount       | Calculation         |
| ----------- | ------------ | ------------------- |
| CM3         | \$42,500     | After marketing     |
| Agency Fees | \$5,000      | Marketing agency    |
| OPEX        | \$15,000     | Operating expenses  |
| Other Costs | \$2,500      | Miscellaneous       |
| **CM4**     | **\$20,000** | \$42,500 − \$22,500 |

***

## How It Works

CM4 is your final contribution margin level—what remains after all variable and fixed costs. It represents true operating profit that can be reinvested in growth or distributed. Configure agency fees, OPEX, and other costs in Cost Settings.

***

## When to Use

| Scenario                     | Action                                               |
| ---------------------------- | ---------------------------------------------------- |
| Measuring true profitability | Use CM4 to see actual operating profit               |
| Planning reinvestment        | Know available profit for growth initiatives         |
| Evaluating business health   | Track CM4 trends to ensure sustainable profitability |
| Setting profit targets       | Use CM4 as the ultimate profitability goal           |

***

## Related Metrics

| Metric                                                                                         | Relationship                       |
| ---------------------------------------------------------------------------------------------- | ---------------------------------- |
| [CM3 (Contribution Margin)](/reference/metrics/orders/contribution-margin/contribution-margin) | Input margin before agency/OPEX    |
| [CM4 %](/reference/metrics/orders/contribution-margin/cm4-percent)                             | CM4 as a percentage of net revenue |
| [CM4 ROAS](/reference/metrics/orders/performance/cm4-roas)                                     | Operating profit per ad dollar     |

[See all Contribution Margin metrics →](/reference/metrics/orders/contribution-margin)
