Value options
| Option | What it sends | Requirements |
|---|---|---|
| Event value | The value already on the event (the default — no override). | — |
| Net Revenue | Revenue after discounts and refunds. | Shopify order data · purchase events |
| CM1 (Gross Margin) | Net revenue minus product cost (COGS). | Shopify order data · purchase events |
| CM2 (After Fulfillment) | CM1 minus shipping, handling, and fees. | Shopify order data · purchase events |
| Fixed value | A set amount you choose (e.g. a flat lead value). | — |
| Custom formula | A value you build yourself. | See below |
add_to_cart can use Net Revenue (revenue only — no cost).
Cost- and revenue-based options need Shopify order data. On non‑Shopify accounts you can still use Fixed value or a Custom formula over your own
data.* fields.Custom formula
The formula builder has two modes:- Simple builder — start with a value, then adjust it step by step (e.g. Event value × 0.7). Each part is a Metric (a known measure), a Field (a custom event field, entered as
data.fieldName), or a Number. Steps apply left to right, like a calculator. - Advanced — write the raw formula directly, with autocomplete for variables. Use
+ − * /and parentheses.
Operands you can reference
| Operand | Meaning | Available on |
|---|---|---|
data.value | The value already on the event. | Every event |
data.<field> | Any custom field on the event (e.g. data.leadValue). | Every event |
orders.gross_revenue | Gross revenue before discounts and refunds. | Shopify purchase |
orders.net_revenue | Revenue after discounts and refunds. | Shopify purchase |
orders.subtotal, orders.tax, orders.discount_amount, orders.refund_amount, orders.units | Order revenue components. | Shopify purchase |
orders.cogs, orders.other_cogs | Cost of goods sold. | Shopify purchase |
orders.shipping_cost, orders.handling_cost, orders.other_fulfillment_cost | Fulfillment costs. | Shopify purchase |
orders.gateway_cost, orders.other_transaction_cost | Transaction/gateway fees. | Shopify purchase |
orders.cogs, orders.shipping_cost, …) are only available on purchase events, where full order cost data exists.
Examples
| Goal | Formula |
|---|---|
| Send 70% of the event value | data.value * 0.7 |
| Send profit (revenue minus product cost) | orders.net_revenue - orders.cogs |
| Subtract a flat fee from the value | data.value - 15 |
| Scale a custom lead value | data.leadValue * 0.4 |
A missing field skips the formula — it doesn’t zero your value. If an event doesn’t carry a field your formula references (say
data.leadValue on an event that didn’t send it), Upstack skips the override and forwards the event’s own value instead, so a missing field never overwrites a real value with 0. A field that is present but genuinely 0 is used as 0. Still, reference only fields your events reliably send, so the formula applies when you expect it to.Related
Global event mappings
Create a mapping once and send it to every destination.
Cost settings
Configure the costs behind Net Revenue, CM1, and CM2.
Custom events overview
What custom events are and when to use them.
Approve Meta custom events
Approve and verify custom events in Meta Events Manager.