01Run it
Replace the <placeholders> with your own values, or use the builder below.
p202 attribution journeys02What 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 attribution journeys --period last30 average_touches: 1.06 conversions: 121 length_distribution: [{"conversions":114,"touches":1},{"conversions":7,"touches":2}] one_touch: 114 one_touch_by_browser: [{"browser":"Chrome","conversions":44,"one_touch":44,"one_touch_share":1},{"browser":"Mobile Safari","conversions":34,"one_touch":31,"one_touch_share":0.9118},{"browser":"Chrome Mobile","conversions":19,"one_touch":17,"one_touch_share":0.8947},{"browser":"Safari","conversions":18,"one_touch":16,"one_touch_share":0.8889},{"browser":"Edge","conversions":3,"one_touch":3,"one_touch_share":1},{"browser":"Samsung Internet","conversions":3,"one_touch":3,"one_touch_share":1}] one_touch_share: 0.9421 recent_conversions: [{"amount":"29.00000","campaign_name":"Free Trial to Paid / CA","conv_id":166,"conv_time":1791540126,"counted":true,"identified":true,"recorded_amount":"29.00000","touches":1,"truncated":false},{"amount":"29.00000","campaign_name":"Free Trial to Paid / CA","conv_id":163,"conv_time":1791540126,"counted":true,"identified":true,"recorded_amount":"29.00000","touches":1,"truncated":false},{"amount":"32.00000","campaign_name":"Coffee Subscription / US","conv_id":53,"conv_time":1791539206,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":2,"truncated":false},{"amount":"348.00000","campaign_name":"Project Tool Pro Annual / US","conv_id":46,"conv_time":1791539206,"counted":true,"identified":true,"recorded_amount":"348.00000","touches":1,"truncated":false},{"amount":"32.00000","campaign_name":"Coffee Subscription / US","conv_id":60,"conv_time":1791479542,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":2,"truncated":false},{"amount":"32.00000","campaign_name":"Coffee Subscription / US","conv_id":27,"conv_time":1791459298,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":1,"truncated":false},{"amount":"59.00000","campaign_name":"Standing Desk Launch / UK","conv_id":33,"conv_time":1791459019,"counted":true,"identified":true,"recorded_amount":"59.00000","touches":1,"truncated":false},{"amount":"29.00000","campaign_name":"Free Trial to Paid / CA","conv_id":40,"conv_time":1791452596,"counted":true,"identified":true,"recorded_amount":"29.00000","touches":1,"truncated":false},{"amount":"130.00000","campaign_name":"Spring Collection / US","conv_id":35,"conv_time":1791377586,"counted":true,"identified":true,"recorded_amount":"130.00000","touches":1,"truncated":false},{"amount":"102.00000","campaign_name":"Spring Collection / US","conv_id":72,"conv_time":1791357768,"counted":true,"identified":true,"recorded_amount":"102.00000","touches":1,"truncated":false},{"amount":"607.00000","campaign_name":"Standing Desk Launch / UK","conv_id":18,"conv_time":1791356492,"counted":true,"identified":true,"recorded_amount":"607.00000","touches":1,"truncated":false},{"amount":"29.00000","campaign_name":"Free Trial to Paid / CA","conv_id":161,"conv_time":1791333799,"counted":true,"identified":true,"recorded_amount":"29.00000","touches":1,"truncated":false},{"amount":"32.00000","campaign_name":"Coffee Subscription / US","conv_id":94,"conv_time":1791330741,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":1,"truncated":false},{"amount":"348.00000","campaign_name":"Project Tool Pro Annual / US","conv_id":4,"conv_time":1791303994,"counted":true,"identified":true,"recorded_amount":"348.00000","touches":1,"truncated":false},{"amount":"29.00000","campaign_name":"Standing Desk Launch / UK","conv_id":106,"conv_time":1791302235,"counted":true,"identified":true,"recorded_amount":"29.00000","touches":1,"truncated":false},{"amount":"75.00000","campaign_name":"Holiday Gift Cards / AU","conv_id":24,"conv_time":1791296228,"counted":true,"identified":true,"recorded_amount":"75.00000","touches":1,"truncated":false},{"amount":"32.00000","campaign_name":"Coffee Subscription / US","conv_id":5,"conv_time":1791250284,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":1,"truncated":false},{"amount":"34.00000","campaign_name":"Spring Collection / US","conv_id":101,"conv_time":1791246069,"counted":true,"identified":true,"recorded_amount":"34.00000","touches":1,"truncated":false},{"amount":"588.00000","campaign_name":"Project Tool Pro Annual / US","conv_id":115,"conv_time":1791243739,"counted":true,"identified":true,"recorded_amount":"588.00000","touches":1,"truncated":false},{"amount":"214.00000","campaign_name":"Spring Collection / US","conv_id":19,"conv_time":1791231148,"counted":true,"identified":true,"recorded_amount":"214.00000","touches":1,"truncated":false},{"amount":"32.00000","campaign_name":"Coffee Subscription / US","conv_id":47,"conv_time":1791221236,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":2,"truncated":false},{"amount":"156.00000","campaign_name":"Bakery Pre-orders / Local","conv_id":96,"conv_time":1791219616,"counted":true,"identified":true,"recorded_amount":"156.00000","touches":1,"truncated":false},{"amount":"102.00000","campaign_name":"Spring Collection / US","conv_id":3,"conv_time":1791216211,"counted":true,"identified":true,"recorded_amount":"102.00000","touches":1,"truncated":false},{"amount":"50.00000","campaign_name":"Holiday Gift Cards / AU","conv_id":82,"conv_time":1791149199,"counted":true,"identified":true,"recorded_amount":"50.00000","touches":1,"truncated":false},{"amount":"34.00000","campaign_name":"Spring Collection / US","conv_id":92,"conv_time":1791143047,"counted":true,"identified":true,"recorded_amount":"34.00000","touches":1,"truncated":false}] time_to_convert: {"1d_to_7d":7,"1h_to_1d":63,"7d_to_30d":5,"over_30d":0,"under_1h":46} truncated: 0 unidentified: 0
$ p202 attribution journeys --period last30 --json { "data": { "average_touches": 1.06, "conversions": 121, "length_distribution": [ { "conversions": 114, "touches": 1 }, { "conversions": 7, "touches": 2 } ], "one_touch": 114, "one_touch_by_browser": [ { "browser": "Chrome", "conversions": 44, "one_touch": 44, "one_touch_share": 1 }, { "browser": "Mobile Safari", "conversions": 34, "one_touch": 31, "one_touch_share": 0.9118 }, { "browser": "Chrome Mobile", "conversions": 19, "one_touch": 17, "one_touch_share": 0.8947 }, { "browser": "Safari", "conversions": 18, "one_touch": 16, "one_touch_share": 0.8889 }, { "browser": "Edge", "conversions": 3, "one_touch": 3, "one_touch_share": 1 }, { "browser": "Samsung Internet", "conversions": 3, "one_touch": 3, "one_touch_share": 1 } ], "one_touch_share": 0.9421, "recent_conversions": [ { "amount": "29.00000", "campaign_name": "Free Trial to Paid / CA", "conv_id": 166, "conv_time": 1791540126, "counted": true, "identified": true, "recorded_amount": "29.00000", "touches": 1, "truncated": false }, { "amount": "29.00000", "campaign_name": "Free Trial to Paid / CA", "conv_id": 163, "conv_time": 1791540126, "counted": true, "identified": true, "recorded_amount": "29.00000", "touches": 1, "truncated": false }, { "amount": "32.00000", "campaign_name": "Coffee Subscription / US", "conv_id": 53, "conv_time": 1791539206, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 2, "truncated": false }, { "amount": "348.00000", "campaign_name": "Project Tool Pro Annual / US", "conv_id": 46, "conv_time": 1791539206, "counted": true, "identified": true, "recorded_amount": "348.00000", "touches": 1, "truncated": false }, { "amount": "32.00000", "campaign_name": "Coffee Subscription / US", "conv_id": 60, "conv_time": 1791479542, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 2, "truncated": false }, { "amount": "32.00000", "campaign_name": "Coffee Subscription / US", "conv_id": 27, "conv_time": 1791459298, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 1, "truncated": false }, { "amount": "59.00000", "campaign_name": "Standing Desk Launch / UK", "conv_id": 33, "conv_time": 1791459019, "counted": true, "identified": true, "recorded_amount": "59.00000", "touches": 1, "truncated": false }, { "amount": "29.00000", "campaign_name": "Free Trial to Paid / CA", "conv_id": 40, "conv_time": 1791452596, "counted": true, "identified": true, "recorded_amount": "29.00000", "touches": 1, "truncated": false }, { "amount": "130.00000", "campaign_name": "Spring Collection / US", "conv_id": 35, "conv_time": 1791377586, "counted": true, "identified": true, "recorded_amount": "130.00000", "touches": 1, "truncated": false }, { "amount": "102.00000", "campaign_name": "Spring Collection / US", "conv_id": 72, "conv_time": 1791357768, "counted": true, "identified": true, "recorded_amount": "102.00000", "touches": 1, "truncated": false }, { "amount": "607.00000", "campaign_name": "Standing Desk Launch / UK", "conv_id": 18, "conv_time": 1791356492, "counted": true, "identified": true, "recorded_amount": "607.00000", "touches": 1, "truncated": false }, { "amount": "29.00000", "campaign_name": "Free Trial to Paid / CA", "conv_id": 161, "conv_time": 1791333799, "counted": true, "identified": true, "recorded_amount": "29.00000", "touches": 1, "truncated": false }, { "amount": "32.00000", "campaign_name": "Coffee Subscription / US", "conv_id": 94, "conv_time": 1791330741, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 1, "truncated": false }, { "amount": "348.00000", "campaign_name": "Project Tool Pro Annual / US", "conv_id": 4, "conv_time": 1791303994, "counted": true, "identified": true, "recorded_amount": "348.00000", "touches": 1, "truncated": false }, { "amount": "29.00000", "campaign_name": "Standing Desk Launch / UK", "conv_id": 106, "conv_time": 1791302235, "counted": true, "identified": true, "recorded_amount": "29.00000", "touches": 1, "truncated": false }, { "amount": "75.00000", "campaign_name": "Holiday Gift Cards / AU", "conv_id": 24, "conv_time": 1791296228, "counted": true, "identified": true, "recorded_amount": "75.00000", "touches": 1, "truncated": false }, { "amount": "32.00000", "campaign_name": "Coffee Subscription / US", "conv_id": 5, "conv_time": 1791250284, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 1, "truncated": false }, { "amount": "34.00000", "campaign_name": "Spring Collection / US", "conv_id": 101, "conv_time": 1791246069, "counted": true, "identified": true, "recorded_amount": "34.00000", "touches": 1, "truncated": false }, { "amount": "588.00000", "campaign_name": "Project Tool Pro Annual / US", "conv_id": 115, "conv_time": 1791243739, "counted": true, "identified": true, "recorded_amount": "588.00000", "touches": 1, "truncated": false }, { "amount": "214.00000", "campaign_name": "Spring Collection / US", "conv_id": 19, "conv_time": 1791231148, "counted": true, "identified": true, "recorded_amount": "214.00000", "touches": 1, "truncated": false }, { "amount": "32.00000", "campaign_name": "Coffee Subscription / US", "conv_id": 47, "conv_time": 1791221236, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 2, "truncated": false }, { "amount": "156.00000", "campaign_name": "Bakery Pre-orders / Local", "conv_id": 96, "conv_time": 1791219616, "counted": true, "identified": true, "recorded_amount": "156.00000", "touches": 1, "truncated": false }, { "amount": "102.00000", "campaign_name": "Spring Collection / US", "conv_id": 3, "conv_time": 1791216211, "counted": true, "identified": true, "recorded_amount": "102.00000", "touches": 1, "truncated": false }, { "amount": "50.00000", "campaign_name": "Holiday Gift Cards / AU", "conv_id": 82, "conv_time": 1791149199, "counted": true, "identified": true, "recorded_amount": "50.00000", "touches": 1, "truncated": false }, { "amount": "34.00000", "campaign_name": "Spring Collection / US", "conv_id": 92, "conv_time": 1791143047, "counted": true, "identified": true, "recorded_amount": "34.00000", "touches": 1, "truncated": false } ], "time_to_convert": { "1d_to_7d": 7, "1h_to_1d": 63, "7d_to_30d": 5, "over_30d": 0, "under_1h": 46 }, "truncated": 0, "unidentified": 0 }, "meta": { "backfill": null, "time_from": 1788926400, "time_to": 1791540195 } }
03Build your command
Pick values and the command line writes itself, quoted and ready to paste.
p202 attribution journeysSet flags below; the command updates as you type.
04Flags
3 flags, plus the global flags every command takes.
| Flag | What it does |
|---|---|
| --periodstring | Range (default: the last 30 days): today, yesterday, last7, last14, last30, last90, thismonth, lastmonth, thisyear, lastyear, alltimetodayyesterdaylast7last14last30last90thismonthlastmonththisyearlastyearalltime |
| --time-fromstring | Range start, unix seconds |
| --time-tostring | Range end, unix seconds |
05For agents
Running this from an agent
- Read the same facts as JSON:
p202 commands attribution journeys --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 attribution journeys",
"use": "journeys",
"short": "Journey metrics: length distribution, time to convert, one-touch share by browser",
"runnable": true,
"flags": [
{
"name": "period",
"type": "string",
"default": "",
"usage": "Range (default: the last 30 days): 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": "Range start, unix seconds",
"required": false
},
{
"name": "time-to",
"type": "string",
"default": "",
"usage": "Range end, unix seconds",
"required": false
}
]
}