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

# Marketing Cost: User-Defined Marketing Spend Allocated to Orders

> Track user-defined marketing costs allocated to orders in Upstack. Separate from platform ad spend—includes influencer fees, sponsorships, and affiliate commissions.

<Tip>
  User-defined marketing costs allocated to orders, separate from platform ad spend. Configured in Cost Settings.
</Tip>

## Formula

<Info>
  **Marketing Cost** = **SUM** ( Order Cost Entries ) **WHERE** category = marketing
</Info>

### Formula Components

| Metric                                                               | Definition                                            |
| -------------------------------------------------------------------- | ----------------------------------------------------- |
| **Order Cost Entries**                                               | User-defined cost entries configured in Cost Settings |
| [**category = marketing**](/data-dictionary/measures-and-dimensions) | Filters to marketing cost entries                     |

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

***

## Example

Your store allocated **\$12,500 in marketing costs** across orders in Q1:

| Month    | Marketing Cost | Orders | Cost Per Order |
| -------- | -------------- | ------ | -------------- |
| January  | \$3,800        | 1,247  | \$3.05         |
| February | \$4,200        | 1,389  | \$3.02         |
| March    | \$4,500        | 1,512  | \$2.98         |

***

## How It Works

Marketing Cost aggregates user-defined cost entries tagged with the "Marketing" category. These are costs you configure in Cost Settings—influencer fees, affiliate commissions, sponsorships, or other marketing spend not captured by ad platform integrations. Marketing Cost is deducted from CM2 (alongside Agency Fees) to calculate CM3 Contribution Margin.

***

## When to Use

| Scenario                     | Action                                                       |
| ---------------------------- | ------------------------------------------------------------ |
| Track non-ad marketing spend | Capture influencer fees, affiliate commissions, sponsorships |
| Calculate true CM3           | Include all marketing costs for accurate contribution margin |
| Allocate overhead            | Distribute fixed marketing costs across orders               |
| Compare cost sources         | Separate user-defined costs from platform ad spend           |

***

## Related Metrics

| Metric                                                                                             | Relationship                                     |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| [Marketing Cost Per Order](/reference/metrics/orders/contribution-margin/marketing-cost-per-order) | This metric ÷ Total Orders                       |
| [CM2 Per Order](/reference/metrics/orders/contribution-margin/cm2-per-order)                       | Margin before marketing costs are deducted       |
| [CM3 Per Order](/reference/metrics/orders/contribution-margin/cm3-per-order)                       | Result after deducting marketing and agency fees |
| [Agency Fees](/reference/metrics/orders/contribution-margin/agency-fees)                           | Another cost component deducted from CM2         |
| [Total Cost](/reference/metrics/orders/contribution-margin/total-cost)                             | All costs combined including marketing           |

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