p202 ltv breakdown

LTV by acquisition source (campaign, ppc_account, landing_page) or by product

All commands

01Run it

Replace the <placeholders> with your own values, or use the builder below.

p202 ltv breakdown

02What 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
$ 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
Real output · p202 1.9.77 · demo dataexit 0

Customer revenue by campaign

  • Project Tool Pro Annual / US$4,440.00
  • Spring Collection / US$3,782.00
  • Standing Desk Launch / UK$3,492.00
  • Holiday Gift Cards / AU$1,775.00
  • Bakery Pre-orders / Local$1,557.00
  • Coffee Subscription / US$1,116.00
  • Free Trial to Paid / CA$348.00

Drawn from the JSON output above.

p202 ltv breakdown --by product --period last30
$ 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
Real output · p202 1.9.77 · demo dataexit 0

03Build your command

Pick values and the command line writes itself, quoted and ready to paste.

p202 ltv breakdown

Set flags below; the command updates as you type.

04Flags

7 flags, plus the global flags every command takes.

FlagWhat it does
--by, -bstringDimension: campaign, ppc_account, landing_page, product
campaignppc_accountlanding_pageproduct
--cfstringArrayOnly 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, -lstringRows per page (max 500)
--offset, -ostringPagination offset
--period, -pstringPeriod: today, yesterday, last7, last14, last30, last90, thismonth, lastmonth, thisyear, lastyear, alltime
todayyesterdaylast7last14last30last90thismonthlastmonththisyearlastyearalltime
--time-fromstringAcquisition 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-tostringAcquisition 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, CLAUDECODE or another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with a hint.
  • Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure.
p202 commands ltv breakdown --json
{
  "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
    }
  ]
}