@apex-inc/sdk 0.17.1 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apex-inc/sdk",
|
|
3
|
-
"version": "0.17.
|
|
4
|
-
"description": "Event tracking and identity SDK for Apex
|
|
3
|
+
"version": "0.17.3",
|
|
4
|
+
"description": "Event tracking and identity SDK for Apex \u2014 currently in private beta.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -181,10 +181,32 @@ data: {
|
|
|
181
181
|
data: { order_id: "ord_123", value: 99.0, currency: "USD", cost: 48.5 }
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
`unit_cost` aliases: `
|
|
184
|
+
`unit_cost` aliases: `unitCost`, `item_cost`. All three are PER UNIT — Apex
|
|
185
|
+
multiplies by `quantity`. Do not send a line total under any of them, and note
|
|
186
|
+
that `cost` is **not** an alias at the line level: it means an order total, so
|
|
187
|
+
sending a $150 line total as `cost` on a line with `quantity: 3` would be read
|
|
188
|
+
as $450. If you only know the total, use the order-level shape above. Cost is
|
|
185
189
|
never inferred — omit it and every channel is measured and ranked on LTV:CAC,
|
|
186
|
-
which is a complete answer on its own.
|
|
187
|
-
|
|
190
|
+
which is a complete answer on its own.
|
|
191
|
+
|
|
192
|
+
**Cost is all-or-nothing per order.** Every line item that carries a price or a
|
|
193
|
+
product id must also carry a cost, or Apex treats that order as cost-unknown
|
|
194
|
+
and it contributes to LTV:CAC only. This matters most during a rollout: if you
|
|
195
|
+
instrument 70 of 100 SKUs, a mixed order would otherwise report the cost of the
|
|
196
|
+
70% as if it were the whole order, which inflates gross profit rather than
|
|
197
|
+
leaving it blank. Send `cost` at the order level if per-item cost isn't
|
|
198
|
+
available for every line.
|
|
199
|
+
|
|
200
|
+
**How partial coverage is handled.** Apex measures your margin on the orders
|
|
201
|
+
where every item reported a cost, then applies that margin rate to all of the
|
|
202
|
+
channel's revenue. Each channel's LTGP:CAC states the share of revenue the
|
|
203
|
+
margin was measured on, so a partial rollout reads as a small sample rather than
|
|
204
|
+
a wrong number — and LTGP:CAC can never come out above LTV:CAC.
|
|
205
|
+
|
|
206
|
+
**Refunds reverse gross profit.** Send `order_id` on the refund event (or link
|
|
207
|
+
it to the original charge) and Apex reverses that order's margin in proportion
|
|
208
|
+
to the amount refunded. A refund with no way to identify the original order
|
|
209
|
+
still reduces revenue, but leaves the margin untouched.
|
|
188
210
|
|
|
189
211
|
## Event naming conventions
|
|
190
212
|
|