01Run it
Replace the <placeholders> with your own values, or use the builder below.
p202 ltv breakdown02What you get
Captured from the real binary, run against a demo store with 30 days of traffic. Switch tabs to see the same run as JSON, the shape scripts and agents parse.
$ p202 ltv breakdown --by campaign --period last30 id name aov avg_ltv cac customers ltv_cac mrr repeat_rate spend total_orders total_revenue -- ---------------------------- ------------- ------------- ------------ --------- ------------ --------- ----------- --------- ------------ ------------- 4 Project Tool Pro Annual / US 444 444 49.92 10 8.8942 370 0.0000 499.2 10 4440 1 Spring Collection / US 122 157.5833 14.8521 24 10.6102 0 0.2917 356.45 31 3782 3 Standing Desk Launch / UK 436.5 436.5 53.0375 8 8.23 0 0.0000 424.3 8 3492 7 Holiday Gift Cards / AU 98.6111 136.5385 9.1954 13 14.8486 0 0.3846 119.54 18 1775 6 Bakery Pre-orders / Local 59.8846 86.5 1.5 18 57.6667 0 0.4444 27 26 1557 2 Coffee Subscription / US 37.2 37.2 7.153 30 5.2006 736 0.0000 214.59 30 1116 5 Free Trial to Paid / CA 29 29 32.6583 12 0.888 348 0.0000 391.9 12 348
$ p202 ltv breakdown --by campaign --period last30 --json { "breakdown": "campaign", "data": [ { "aov": "444.000000000", "avg_ltv": "444.000000000", "cac": "49.920000000", "customers": 10, "id": 4, "ltv_cac": "8.894230769", "mrr": "370.00000", "name": "Project Tool Pro Annual / US", "repeat_rate": "0.0000", "spend": "499.20000", "total_orders": "10", "total_revenue": "4440.00000" }, { "aov": "122.000000000", "avg_ltv": "157.583333333", "cac": "14.852083333", "customers": 24, "id": 1, "ltv_cac": "10.610183756", "mrr": "0.00000", "name": "Spring Collection / US", "repeat_rate": "0.2917", "spend": "356.45000", "total_orders": "31", "total_revenue": "3782.00000" }, { "aov": "436.500000000", "avg_ltv": "436.500000000", "cac": "53.037500000", "customers": 8, "id": 3, "ltv_cac": "8.230025925", "mrr": "0.00000", "name": "Standing Desk Launch / UK", "repeat_rate": "0.0000", "spend": "424.30000", "total_orders": "8", "total_revenue": "3492.00000" }, { "aov": "98.611111111", "avg_ltv": "136.538461538", "cac": "9.195384615", "customers": 13, "id": 7, "ltv_cac": "14.848586247", "mrr": "0.00000", "name": "Holiday Gift Cards / AU", "repeat_rate": "0.3846", "spend": "119.54000", "total_orders": "18", "total_revenue": "1775.00000" }, { "aov": "59.884615384", "avg_ltv": "86.500000000", "cac": "1.500000000", "customers": 18, "id": 6, "ltv_cac": "57.666666667", "mrr": "0.00000", "name": "Bakery Pre-orders / Local", "repeat_rate": "0.4444", "spend": "27.00000", "total_orders": "26", "total_revenue": "1557.00000" }, { "aov": "37.200000000", "avg_ltv": "37.200000000", "cac": "7.153000000", "customers": 30, "id": 2, "ltv_cac": "5.200615127", "mrr": "736.00000", "name": "Coffee Subscription / US", "repeat_rate": "0.0000", "spend": "214.59000", "total_orders": "30", "total_revenue": "1116.00000" }, { "aov": "29.000000000", "avg_ltv": "29.000000000", "cac": "32.658333333", "customers": 12, "id": 5, "ltv_cac": "0.887981628", "mrr": "348.00000", "name": "Free Trial to Paid / CA", "repeat_rate": "0.0000", "spend": "391.90000", "total_orders": "12", "total_revenue": "348.00000" } ] }
Customer revenue by campaign
Drawn from the JSON output above.
$ p202 ltv breakdown --by product --period last30 id name aov avg_revenue_per_customer customers mrr orders repeat_rate sku total_revenue units -- ----------------------- ------------- ------------------------ --------- ----------- ------ ----------- --------------- ------------- ------ 7 Electric Sit-Stand Desk 489 489 6 0 6 0.0000 DSK-ELECTRIC 2934 6.000 11 Team plan, annual 588 588 4 0 4 0.0000 PT-TEAM-ANNUAL 2352 4.000 10 Pro plan, annual 348 348 6 0 6 0.0000 PT-PRO-ANNUAL 2088 6.000 2 Wrap Dress 96 96 13 0 13 0.0000 SPR-WRAP-DRESS 1248 13.000 15 Celebration Cake 81 88.3636 11 0 12 0.0909 BKY-CAKE 972 18.000 4 Relaxed Chino 78 93.6 10 0 12 0.2000 SPR-CHINO 936 12.000 18 Gift Card $100 100 100 9 0 9 0.0000 GFT-100 900 9.000 1 Linen Shirt 68 68 13 0 13 0.0000 SPR-LINEN-SHIRT 884 13.000 5 Monthly Coffee (2 bags) 32 32 24 0 24 0.0000 COF-MONTHLY 768 24.000 3 Canvas Tote 39.6667 44.625 16 0 18 0.1250 SPR-CANVAS-TOTE 714 21.000 17 Gift Card $50 62.5 62.5 8 0 8 0.0000 GFT-50 500 10.000 8 Anti-fatigue Mat 78.6667 78.6667 6 0 6 0.0000 DSK-MAT 472 8.000 16 Gift Card $25 31.25 34.0909 11 0 12 0.0909 GFT-25 375 15.000 14 Pastry Box (6) 27.6923 30 12 0 13 0.0833 BKY-PASTRY-BOX 360 15.000 6 Starter Box 58 58 6 0 6 0.0000 COF-STARTER 348 6.000 12 Team plan, monthly 29 29 12 0 12 0.0000 PT-TEAM-MONTHLY 348 12.000 13 Sourdough Loaf 11.8421 15 15 0 19 0.2667 BKY-SOURDOUGH 225 25.000 9 Cable Tray 29 29 5 0 5 0.0000 DSK-CABLE 145 5.000
$ p202 ltv breakdown --by product --period last30 --json { "breakdown": "product", "data": [ { "aov": "489.000000000", "avg_revenue_per_customer": "489.000000000", "customers": 6, "id": 7, "mrr": "0.000000000", "name": "Electric Sit-Stand Desk", "orders": "6", "repeat_rate": "0.0000", "sku": "DSK-ELECTRIC", "total_revenue": "2934.00000", "units": "6.000" }, { "aov": "588.000000000", "avg_revenue_per_customer": "588.000000000", "customers": 4, "id": 11, "mrr": "0.000000000", "name": "Team plan, annual", "orders": "4", "repeat_rate": "0.0000", "sku": "PT-TEAM-ANNUAL", "total_revenue": "2352.00000", "units": "4.000" }, { "aov": "348.000000000", "avg_revenue_per_customer": "348.000000000", "customers": 6, "id": 10, "mrr": "0.000000000", "name": "Pro plan, annual", "orders": "6", "repeat_rate": "0.0000", "sku": "PT-PRO-ANNUAL", "total_revenue": "2088.00000", "units": "6.000" }, { "aov": "96.000000000", "avg_revenue_per_customer": "96.000000000", "customers": 13, "id": 2, "mrr": "0.000000000", "name": "Wrap Dress", "orders": "13", "repeat_rate": "0.0000", "sku": "SPR-WRAP-DRESS", "total_revenue": "1248.00000", "units": "13.000" }, { "aov": "81.000000000", "avg_revenue_per_customer": "88.363636363", "customers": 11, "id": 15, "mrr": "0.000000000", "name": "Celebration Cake", "orders": "12", "repeat_rate": "0.0909", "sku": "BKY-CAKE", "total_revenue": "972.00000", "units": "18.000" }, { "aov": "78.000000000", "avg_revenue_per_customer": "93.600000000", "customers": 10, "id": 4, "mrr": "0.000000000", "name": "Relaxed Chino", "orders": "12", "repeat_rate": "0.2000", "sku": "SPR-CHINO", "total_revenue": "936.00000", "units": "12.000" }, { "aov": "100.000000000", "avg_revenue_per_customer": "100.000000000", "customers": 9, "id": 18, "mrr": "0.000000000", "name": "Gift Card $100", "orders": "9", "repeat_rate": "0.0000", "sku": "GFT-100", "total_revenue": "900.00000", "units": "9.000" }, { "aov": "68.000000000", "avg_revenue_per_customer": "68.000000000", "customers": 13, "id": 1, "mrr": "0.000000000", "name": "Linen Shirt", "orders": "13", "repeat_rate": "0.0000", "sku": "SPR-LINEN-SHIRT", "total_revenue": "884.00000", "units": "13.000" }, { "aov": "32.000000000", "avg_revenue_per_customer": "32.000000000", "customers": 24, "id": 5, "mrr": "0.000000000", "name": "Monthly Coffee (2 bags)", "orders": "24", "repeat_rate": "0.0000", "sku": "COF-MONTHLY", "total_revenue": "768.00000", "units": "24.000" }, { "aov": "39.666666666", "avg_revenue_per_customer": "44.625000000", "customers": 16, "id": 3, "mrr": "0.000000000", "name": "Canvas Tote", "orders": "18", "repeat_rate": "0.1250", "sku": "SPR-CANVAS-TOTE", "total_revenue": "714.00000", "units": "21.000" }, { "aov": "62.500000000", "avg_revenue_per_customer": "62.500000000", "customers": 8, "id": 17, "mrr": "0.000000000", "name": "Gift Card $50", "orders": "8", "repeat_rate": "0.0000", "sku": "GFT-50", "total_revenue": "500.00000", "units": "10.000" }, { "aov": "78.666666666", "avg_revenue_per_customer": "78.666666666", "customers": 6, "id": 8, "mrr": "0.000000000", "name": "Anti-fatigue Mat", "orders": "6", "repeat_rate": "0.0000", "sku": "DSK-MAT", "total_revenue": "472.00000", "units": "8.000" }, { "aov": "31.250000000", "avg_revenue_per_customer": "34.090909090", "customers": 11, "id": 16, "mrr": "0.000000000", "name": "Gift Card $25", "orders": "12", "repeat_rate": "0.0909", "sku": "GFT-25", "total_revenue": "375.00000", "units": "15.000" }, { "aov": "27.692307692", "avg_revenue_per_customer": "30.000000000", "customers": 12, "id": 14, "mrr": "0.000000000", "name": "Pastry Box (6)", "orders": "13", "repeat_rate": "0.0833", "sku": "BKY-PASTRY-BOX", "total_revenue": "360.00000", "units": "15.000" }, { "aov": "58.000000000", "avg_revenue_per_customer": "58.000000000", "customers": 6, "id": 6, "mrr": "0.000000000", "name": "Starter Box", "orders": "6", "repeat_rate": "0.0000", "sku": "COF-STARTER", "total_revenue": "348.00000", "units": "6.000" }, { "aov": "29.000000000", "avg_revenue_per_customer": "29.000000000", "customers": 12, "id": 12, "mrr": "0.000000000", "name": "Team plan, monthly", "orders": "12", "repeat_rate": "0.0000", "sku": "PT-TEAM-MONTHLY", "total_revenue": "348.00000", "units": "12.000" }, { "aov": "11.842105263", "avg_revenue_per_customer": "15.000000000", "customers": 15, "id": 13, "mrr": "0.000000000", "name": "Sourdough Loaf", "orders": "19", "repeat_rate": "0.2667", "sku": "BKY-SOURDOUGH", "total_revenue": "225.00000", "units": "25.000" }, { "aov": "29.000000000", "avg_revenue_per_customer": "29.000000000", "customers": 5, "id": 9, "mrr": "0.000000000", "name": "Cable Tray", "orders": "5", "repeat_rate": "0.0000", "sku": "DSK-CABLE", "total_revenue": "145.00000", "units": "5.000" } ] }
03Build your command
Pick values and the command line writes itself, quoted and ready to paste.
p202 ltv breakdownSet flags below; the command updates as you type.
04Flags
7 flags, plus the global flags every command takes.
| Flag | What it does |
|---|---|
| --by, -bstring | Dimension: campaign, ppc_account, landing_page, productcampaignppc_accountlanding_pageproduct |
| --cfstringArray | Only customers whose custom field matches: key=value, or key.min=value / key.max=value for a number or date field (repeatable, at most 3; p202 ltv fields list shows the keys) |
| --limit, -lstring | Rows per page (max 500) |
| --offset, -ostring | Pagination offset |
| --period, -pstring | Period: today, yesterday, last7, last14, last30, last90, thismonth, lastmonth, thisyear, lastyear, alltimetodayyesterdaylast7last14last30last90thismonthlastmonththisyearlastyearalltime |
| --time-fromstring | Acquisition window start: unix seconds, a date (2026-10-01, from its first second in the account's timezone) or a time with its offset (2026-10-01T09:30:00Z) |
| --time-tostring | Acquisition window end, inclusive: unix seconds, a date (2026-10-01, through its last second in the account's timezone) or a time with its offset |
05For agents
Running this from an agent
- Read the same facts as JSON:
p202 commands ltv breakdown --json. - With
AI_AGENT,CLAUDECODEor another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with ahint. - Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure.
{
"path": "p202 ltv breakdown",
"use": "breakdown",
"short": "LTV by acquisition source (campaign, ppc_account, landing_page) or by product",
"runnable": true,
"flags": [
{
"name": "by",
"shorthand": "b",
"type": "string",
"default": "",
"usage": "Dimension: campaign, ppc_account, landing_page, product",
"allowed_values": [
"campaign",
"ppc_account",
"landing_page",
"product"
],
"required": false
},
{
"name": "cf",
"type": "stringArray",
"default": "[]",
"usage": "Only customers whose custom field matches: key=value, or key.min=value / key.max=value for a number or date field (repeatable, at most 3; `p202 ltv fields list` shows the keys)",
"required": false
},
{
"name": "limit",
"shorthand": "l",
"type": "string",
"default": "",
"usage": "Rows per page (max 500)",
"required": false
},
{
"name": "offset",
"shorthand": "o",
"type": "string",
"default": "",
"usage": "Pagination offset",
"required": false
},
{
"name": "period",
"shorthand": "p",
"type": "string",
"default": "",
"usage": "Period: today, yesterday, last7, last14, last30, last90, thismonth, lastmonth, thisyear, lastyear, alltime",
"allowed_values": [
"today",
"yesterday",
"last7",
"last14",
"last30",
"last90",
"thismonth",
"lastmonth",
"thisyear",
"lastyear",
"alltime"
],
"required": false
},
{
"name": "time-from",
"type": "string",
"default": "",
"usage": "Acquisition window start: unix seconds, a date (2026-10-01, from its first second in the account's timezone) or a time with its offset (2026-10-01T09:30:00Z)",
"required": false
},
{
"name": "time-to",
"type": "string",
"default": "",
"usage": "Acquisition window end, inclusive: unix seconds, a date (2026-10-01, through its last second in the account's timezone) or a time with its offset",
"required": false
}
]
}