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 403.3846 403.3846 38.4 13 10.5048 437 0.0000 499.2 13 5244 1 Spring Collection / US 115.8947 176.16 14.258 25 12.3552 0 0.5200 356.45 38 4404 3 Standing Desk Launch / UK 369.6 369.6 84.86 5 4.3554 0 0.0000 424.3 5 1848 6 Bakery Pre-orders / Local 61.2 79.8261 1.1661 23 68.4564 0 0.3043 26.82 30 1836 7 Holiday Gift Cards / AU 104.4118 136.5385 9.1715 13 14.8872 0 0.3077 119.23 17 1775 2 Coffee Subscription / US 38 38 8.2681 26 4.596 608 0.0000 214.97 26 988 5 Free Trial to Paid / CA 29 29 43.5444 9 0.666 232 0.0000 391.9 9 261
$ p202 ltv breakdown --by campaign --period last30 --json { "breakdown": "campaign", "data": [ { "aov": "403.384615384", "avg_ltv": "403.384615384", "cac": "38.400000000", "customers": 13, "id": 4, "ltv_cac": "10.504807692", "mrr": "437.00000", "name": "Project Tool Pro Annual / US", "repeat_rate": "0.0000", "spend": "499.20000", "total_orders": "13", "total_revenue": "5244.00000" }, { "aov": "115.894736842", "avg_ltv": "176.160000000", "cac": "14.258000000", "customers": 25, "id": 1, "ltv_cac": "12.355169028", "mrr": "0.00000", "name": "Spring Collection / US", "repeat_rate": "0.5200", "spend": "356.45000", "total_orders": "38", "total_revenue": "4404.00000" }, { "aov": "369.600000000", "avg_ltv": "369.600000000", "cac": "84.860000000", "customers": 5, "id": 3, "ltv_cac": "4.355408909", "mrr": "0.00000", "name": "Standing Desk Launch / UK", "repeat_rate": "0.0000", "spend": "424.30000", "total_orders": "5", "total_revenue": "1848.00000" }, { "aov": "61.200000000", "avg_ltv": "79.826086956", "cac": "1.166086956", "customers": 23, "id": 6, "ltv_cac": "68.456375839", "mrr": "0.00000", "name": "Bakery Pre-orders / Local", "repeat_rate": "0.3043", "spend": "26.82000", "total_orders": "30", "total_revenue": "1836.00000" }, { "aov": "104.411764705", "avg_ltv": "136.538461538", "cac": "9.171538461", "customers": 13, "id": 7, "ltv_cac": "14.887192821", "mrr": "0.00000", "name": "Holiday Gift Cards / AU", "repeat_rate": "0.3077", "spend": "119.23000", "total_orders": "17", "total_revenue": "1775.00000" }, { "aov": "38.000000000", "avg_ltv": "38.000000000", "cac": "8.268076923", "customers": 26, "id": 2, "ltv_cac": "4.595990138", "mrr": "608.00000", "name": "Coffee Subscription / US", "repeat_rate": "0.0000", "spend": "214.97000", "total_orders": "26", "total_revenue": "988.00000" }, { "aov": "29.000000000", "avg_ltv": "29.000000000", "cac": "43.544444444", "customers": 9, "id": 5, "ltv_cac": "0.665986221", "mrr": "232.00000", "name": "Free Trial to Paid / CA", "repeat_rate": "0.0000", "spend": "391.90000", "total_orders": "9", "total_revenue": "261.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 -- ----------------------- ------------- ------------------------ --------- ----------- ------ ----------- --------------- ------------- ------ 10 Pro plan, annual 348 348 10 0 10 0.0000 PT-PRO-ANNUAL 3480 10.000 11 Team plan, annual 588 588 3 0 3 0.0000 PT-TEAM-ANNUAL 1764 3.000 2 Wrap Dress 96 108 16 0 18 0.1250 SPR-WRAP-DRESS 1728 18.000 7 Electric Sit-Stand Desk 489 489 3 0 3 0.0000 DSK-ELECTRIC 1467 3.000 4 Relaxed Chino 78 89.1429 14 0 16 0.1429 SPR-CHINO 1248 16.000 15 Celebration Cake 66.7059 70.875 16 0 17 0.0625 BKY-CAKE 1134 21.000 1 Linen Shirt 68 68 12 0 12 0.0000 SPR-LINEN-SHIRT 816 12.000 18 Gift Card $100 100 100 8 0 8 0.0000 GFT-100 800 8.000 17 Gift Card $50 58.3333 58.3333 12 0 12 0.0000 GFT-50 700 14.000 5 Monthly Coffee (2 bags) 32 32 20 0 20 0.0000 COF-MONTHLY 640 20.000 3 Canvas Tote 40.8 43.7143 14 0 15 0.0714 SPR-CANVAS-TOTE 612 18.000 14 Pastry Box (6) 28 29.6471 17 0 18 0.0588 BKY-PASTRY-BOX 504 21.000 6 Starter Box 58 58 6 0 6 0.0000 COF-STARTER 348 6.000 8 Anti-fatigue Mat 73.75 73.75 4 0 4 0.0000 DSK-MAT 295 5.000 16 Gift Card $25 25 30.5556 9 0 11 0.2222 GFT-25 275 11.000 12 Team plan, monthly 29 29 9 0 9 0.0000 PT-TEAM-MONTHLY 261 9.000 13 Sourdough Loaf 12.375 13.2 15 0 16 0.0667 BKY-SOURDOUGH 198 22.000 9 Cable Tray 48.3333 48.3333 3 0 3 0.0000 DSK-CABLE 145 5.000
$ p202 ltv breakdown --by product --period last30 --json { "breakdown": "product", "data": [ { "aov": "348.000000000", "avg_revenue_per_customer": "348.000000000", "customers": 10, "id": 10, "mrr": "0.000000000", "name": "Pro plan, annual", "orders": "10", "repeat_rate": "0.0000", "sku": "PT-PRO-ANNUAL", "total_revenue": "3480.00000", "units": "10.000" }, { "aov": "588.000000000", "avg_revenue_per_customer": "588.000000000", "customers": 3, "id": 11, "mrr": "0.000000000", "name": "Team plan, annual", "orders": "3", "repeat_rate": "0.0000", "sku": "PT-TEAM-ANNUAL", "total_revenue": "1764.00000", "units": "3.000" }, { "aov": "96.000000000", "avg_revenue_per_customer": "108.000000000", "customers": 16, "id": 2, "mrr": "0.000000000", "name": "Wrap Dress", "orders": "18", "repeat_rate": "0.1250", "sku": "SPR-WRAP-DRESS", "total_revenue": "1728.00000", "units": "18.000" }, { "aov": "489.000000000", "avg_revenue_per_customer": "489.000000000", "customers": 3, "id": 7, "mrr": "0.000000000", "name": "Electric Sit-Stand Desk", "orders": "3", "repeat_rate": "0.0000", "sku": "DSK-ELECTRIC", "total_revenue": "1467.00000", "units": "3.000" }, { "aov": "78.000000000", "avg_revenue_per_customer": "89.142857142", "customers": 14, "id": 4, "mrr": "0.000000000", "name": "Relaxed Chino", "orders": "16", "repeat_rate": "0.1429", "sku": "SPR-CHINO", "total_revenue": "1248.00000", "units": "16.000" }, { "aov": "66.705882352", "avg_revenue_per_customer": "70.875000000", "customers": 16, "id": 15, "mrr": "0.000000000", "name": "Celebration Cake", "orders": "17", "repeat_rate": "0.0625", "sku": "BKY-CAKE", "total_revenue": "1134.00000", "units": "21.000" }, { "aov": "68.000000000", "avg_revenue_per_customer": "68.000000000", "customers": 12, "id": 1, "mrr": "0.000000000", "name": "Linen Shirt", "orders": "12", "repeat_rate": "0.0000", "sku": "SPR-LINEN-SHIRT", "total_revenue": "816.00000", "units": "12.000" }, { "aov": "100.000000000", "avg_revenue_per_customer": "100.000000000", "customers": 8, "id": 18, "mrr": "0.000000000", "name": "Gift Card $100", "orders": "8", "repeat_rate": "0.0000", "sku": "GFT-100", "total_revenue": "800.00000", "units": "8.000" }, { "aov": "58.333333333", "avg_revenue_per_customer": "58.333333333", "customers": 12, "id": 17, "mrr": "0.000000000", "name": "Gift Card $50", "orders": "12", "repeat_rate": "0.0000", "sku": "GFT-50", "total_revenue": "700.00000", "units": "14.000" }, { "aov": "32.000000000", "avg_revenue_per_customer": "32.000000000", "customers": 20, "id": 5, "mrr": "0.000000000", "name": "Monthly Coffee (2 bags)", "orders": "20", "repeat_rate": "0.0000", "sku": "COF-MONTHLY", "total_revenue": "640.00000", "units": "20.000" }, { "aov": "40.800000000", "avg_revenue_per_customer": "43.714285714", "customers": 14, "id": 3, "mrr": "0.000000000", "name": "Canvas Tote", "orders": "15", "repeat_rate": "0.0714", "sku": "SPR-CANVAS-TOTE", "total_revenue": "612.00000", "units": "18.000" }, { "aov": "28.000000000", "avg_revenue_per_customer": "29.647058823", "customers": 17, "id": 14, "mrr": "0.000000000", "name": "Pastry Box (6)", "orders": "18", "repeat_rate": "0.0588", "sku": "BKY-PASTRY-BOX", "total_revenue": "504.00000", "units": "21.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": "73.750000000", "avg_revenue_per_customer": "73.750000000", "customers": 4, "id": 8, "mrr": "0.000000000", "name": "Anti-fatigue Mat", "orders": "4", "repeat_rate": "0.0000", "sku": "DSK-MAT", "total_revenue": "295.00000", "units": "5.000" }, { "aov": "25.000000000", "avg_revenue_per_customer": "30.555555555", "customers": 9, "id": 16, "mrr": "0.000000000", "name": "Gift Card $25", "orders": "11", "repeat_rate": "0.2222", "sku": "GFT-25", "total_revenue": "275.00000", "units": "11.000" }, { "aov": "29.000000000", "avg_revenue_per_customer": "29.000000000", "customers": 9, "id": 12, "mrr": "0.000000000", "name": "Team plan, monthly", "orders": "9", "repeat_rate": "0.0000", "sku": "PT-TEAM-MONTHLY", "total_revenue": "261.00000", "units": "9.000" }, { "aov": "12.375000000", "avg_revenue_per_customer": "13.200000000", "customers": 15, "id": 13, "mrr": "0.000000000", "name": "Sourdough Loaf", "orders": "16", "repeat_rate": "0.0667", "sku": "BKY-SOURDOUGH", "total_revenue": "198.00000", "units": "22.000" }, { "aov": "48.333333333", "avg_revenue_per_customer": "48.333333333", "customers": 3, "id": 9, "mrr": "0.000000000", "name": "Cable Tray", "orders": "3", "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, 6 no Pro licence on the install.
{
"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
}
]
}