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  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
Real output · p202 1.9.78 · demo dataexit 0

Customer revenue by campaign

  • Project Tool Pro Annual / US$5,244.00
  • Spring Collection / US$4,404.00
  • Standing Desk Launch / UK$1,848.00
  • Bakery Pre-orders / Local$1,836.00
  • Holiday Gift Cards / AU$1,775.00
  • Coffee Subscription / US$988.00
  • Free Trial to Paid / CA$261.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
--  -----------------------  -------------  ------------------------  ---------  -----------  ------  -----------  ---------------  -------------  ------
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
Real output · p202 1.9.78 · 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, 6 no Pro licence on the install.
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
    }
  ]
}