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.07 conversions: 120 length_distribution: [{"conversions":112,"touches":1},{"conversions":8,"touches":2}] one_touch: 112 one_touch_by_browser: [{"browser":"Mobile Safari","conversions":39,"one_touch":35,"one_touch_share":0.8974},{"browser":"Chrome","conversions":33,"one_touch":30,"one_touch_share":0.9091},{"browser":"Safari","conversions":20,"one_touch":20,"one_touch_share":1},{"browser":"Chrome Mobile","conversions":18,"one_touch":18,"one_touch_share":1},{"browser":"Edge","conversions":5,"one_touch":5,"one_touch_share":1},{"browser":"Samsung Internet","conversions":4,"one_touch":3,"one_touch_share":0.75},{"browser":"Firefox","conversions":1,"one_touch":1,"one_touch_share":1}] one_touch_share: 0.9333 recent_conversions: [{"amount":"141.00000","campaign_name":"Bakery Pre-orders / Local","conv_id":48,"conv_time":1792621991,"counted":true,"identified":true,"recorded_amount":"141.00000","touches":1,"truncated":false},{"amount":"32.00000","campaign_name":"Coffee Subscription / US","conv_id":2,"conv_time":1792618982,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":1,"truncated":false},{"amount":"32.00000","campaign_name":"Coffee Subscription / US","conv_id":85,"conv_time":1792611561,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":1,"truncated":false},{"amount":"78.00000","campaign_name":"Spring Collection / US","conv_id":43,"conv_time":1792610762,"counted":true,"identified":true,"recorded_amount":"78.00000","touches":1,"truncated":false},{"amount":"59.00000","campaign_name":"Standing Desk Launch / UK","conv_id":83,"conv_time":1792607372,"counted":true,"identified":true,"recorded_amount":"59.00000","touches":1,"truncated":false},{"amount":"146.00000","campaign_name":"Spring Collection / US","conv_id":97,"conv_time":1792597344,"counted":true,"identified":true,"recorded_amount":"146.00000","touches":1,"truncated":false},{"amount":"29.00000","campaign_name":"Free Trial to Paid / CA","conv_id":9,"conv_time":1792596206,"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":1792589574,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":1,"truncated":false},{"amount":"225.00000","campaign_name":"Holiday Gift Cards / AU","conv_id":6,"conv_time":1792588984,"counted":true,"identified":true,"recorded_amount":"225.00000","touches":1,"truncated":false},{"amount":"164.00000","campaign_name":"Spring Collection / US","conv_id":4,"conv_time":1792563469,"counted":true,"identified":true,"recorded_amount":"164.00000","touches":1,"truncated":false},{"amount":"180.00000","campaign_name":"Spring Collection / US","conv_id":10,"conv_time":1792546064,"counted":true,"identified":true,"recorded_amount":"180.00000","touches":1,"truncated":false},{"amount":"18.00000","campaign_name":"Bakery Pre-orders / Local","conv_id":73,"conv_time":1792541824,"counted":true,"identified":true,"recorded_amount":"18.00000","touches":2,"truncated":false},{"amount":"29.00000","campaign_name":"Free Trial to Paid / CA","conv_id":100,"conv_time":1792538341,"counted":true,"identified":true,"recorded_amount":"29.00000","touches":1,"truncated":false},{"amount":"96.00000","campaign_name":"Bakery Pre-orders / Local","conv_id":108,"conv_time":1792537221,"counted":true,"identified":true,"recorded_amount":"96.00000","touches":1,"truncated":false},{"amount":"29.00000","campaign_name":"Free Trial to Paid / CA","conv_id":103,"conv_time":1792531218,"counted":true,"identified":true,"recorded_amount":"29.00000","touches":2,"truncated":false},{"amount":"175.00000","campaign_name":"Holiday Gift Cards / AU","conv_id":60,"conv_time":1792522686,"counted":true,"identified":true,"recorded_amount":"175.00000","touches":1,"truncated":false},{"amount":"32.00000","campaign_name":"Coffee Subscription / US","conv_id":91,"conv_time":1792480668,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":1,"truncated":false},{"amount":"32.00000","campaign_name":"Coffee Subscription / US","conv_id":39,"conv_time":1792467256,"counted":true,"identified":true,"recorded_amount":"32.00000","touches":1,"truncated":false},{"amount":"125.00000","campaign_name":"Holiday Gift Cards / AU","conv_id":41,"conv_time":1792424376,"counted":true,"identified":true,"recorded_amount":"125.00000","touches":1,"truncated":false},{"amount":"208.00000","campaign_name":"Spring Collection / US","conv_id":30,"conv_time":1792421176,"counted":true,"identified":true,"recorded_amount":"208.00000","touches":1,"truncated":false},{"amount":"577.00000","campaign_name":"Standing Desk Launch / UK","conv_id":52,"conv_time":1792414880,"counted":true,"identified":true,"recorded_amount":"577.00000","touches":1,"truncated":false},{"amount":"174.00000","campaign_name":"Spring Collection / US","conv_id":35,"conv_time":1792408826,"counted":true,"identified":true,"recorded_amount":"174.00000","touches":1,"truncated":false},{"amount":"348.00000","campaign_name":"Project Tool Pro Annual / US","conv_id":99,"conv_time":1792362110,"counted":true,"identified":true,"recorded_amount":"348.00000","touches":1,"truncated":false},{"amount":"29.00000","campaign_name":"Free Trial to Paid / CA","conv_id":17,"conv_time":1792347619,"counted":true,"identified":true,"recorded_amount":"29.00000","touches":1,"truncated":false},{"amount":"348.00000","campaign_name":"Project Tool Pro Annual / US","conv_id":12,"conv_time":1792330333,"counted":true,"identified":true,"recorded_amount":"348.00000","touches":2,"truncated":false}] time_to_convert: {"1d_to_7d":6,"1h_to_1d":70,"7d_to_30d":6,"over_30d":0,"under_1h":38} truncated: 0 unidentified: 0
$ p202 attribution journeys --period last30 --json { "data": { "average_touches": 1.07, "conversions": 120, "length_distribution": [ { "conversions": 112, "touches": 1 }, { "conversions": 8, "touches": 2 } ], "one_touch": 112, "one_touch_by_browser": [ { "browser": "Mobile Safari", "conversions": 39, "one_touch": 35, "one_touch_share": 0.8974 }, { "browser": "Chrome", "conversions": 33, "one_touch": 30, "one_touch_share": 0.9091 }, { "browser": "Safari", "conversions": 20, "one_touch": 20, "one_touch_share": 1 }, { "browser": "Chrome Mobile", "conversions": 18, "one_touch": 18, "one_touch_share": 1 }, { "browser": "Edge", "conversions": 5, "one_touch": 5, "one_touch_share": 1 }, { "browser": "Samsung Internet", "conversions": 4, "one_touch": 3, "one_touch_share": 0.75 }, { "browser": "Firefox", "conversions": 1, "one_touch": 1, "one_touch_share": 1 } ], "one_touch_share": 0.9333, "recent_conversions": [ { "amount": "141.00000", "campaign_name": "Bakery Pre-orders / Local", "conv_id": 48, "conv_time": 1792621991, "counted": true, "identified": true, "recorded_amount": "141.00000", "touches": 1, "truncated": false }, { "amount": "32.00000", "campaign_name": "Coffee Subscription / US", "conv_id": 2, "conv_time": 1792618982, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 1, "truncated": false }, { "amount": "32.00000", "campaign_name": "Coffee Subscription / US", "conv_id": 85, "conv_time": 1792611561, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 1, "truncated": false }, { "amount": "78.00000", "campaign_name": "Spring Collection / US", "conv_id": 43, "conv_time": 1792610762, "counted": true, "identified": true, "recorded_amount": "78.00000", "touches": 1, "truncated": false }, { "amount": "59.00000", "campaign_name": "Standing Desk Launch / UK", "conv_id": 83, "conv_time": 1792607372, "counted": true, "identified": true, "recorded_amount": "59.00000", "touches": 1, "truncated": false }, { "amount": "146.00000", "campaign_name": "Spring Collection / US", "conv_id": 97, "conv_time": 1792597344, "counted": true, "identified": true, "recorded_amount": "146.00000", "touches": 1, "truncated": false }, { "amount": "29.00000", "campaign_name": "Free Trial to Paid / CA", "conv_id": 9, "conv_time": 1792596206, "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": 1792589574, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 1, "truncated": false }, { "amount": "225.00000", "campaign_name": "Holiday Gift Cards / AU", "conv_id": 6, "conv_time": 1792588984, "counted": true, "identified": true, "recorded_amount": "225.00000", "touches": 1, "truncated": false }, { "amount": "164.00000", "campaign_name": "Spring Collection / US", "conv_id": 4, "conv_time": 1792563469, "counted": true, "identified": true, "recorded_amount": "164.00000", "touches": 1, "truncated": false }, { "amount": "180.00000", "campaign_name": "Spring Collection / US", "conv_id": 10, "conv_time": 1792546064, "counted": true, "identified": true, "recorded_amount": "180.00000", "touches": 1, "truncated": false }, { "amount": "18.00000", "campaign_name": "Bakery Pre-orders / Local", "conv_id": 73, "conv_time": 1792541824, "counted": true, "identified": true, "recorded_amount": "18.00000", "touches": 2, "truncated": false }, { "amount": "29.00000", "campaign_name": "Free Trial to Paid / CA", "conv_id": 100, "conv_time": 1792538341, "counted": true, "identified": true, "recorded_amount": "29.00000", "touches": 1, "truncated": false }, { "amount": "96.00000", "campaign_name": "Bakery Pre-orders / Local", "conv_id": 108, "conv_time": 1792537221, "counted": true, "identified": true, "recorded_amount": "96.00000", "touches": 1, "truncated": false }, { "amount": "29.00000", "campaign_name": "Free Trial to Paid / CA", "conv_id": 103, "conv_time": 1792531218, "counted": true, "identified": true, "recorded_amount": "29.00000", "touches": 2, "truncated": false }, { "amount": "175.00000", "campaign_name": "Holiday Gift Cards / AU", "conv_id": 60, "conv_time": 1792522686, "counted": true, "identified": true, "recorded_amount": "175.00000", "touches": 1, "truncated": false }, { "amount": "32.00000", "campaign_name": "Coffee Subscription / US", "conv_id": 91, "conv_time": 1792480668, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 1, "truncated": false }, { "amount": "32.00000", "campaign_name": "Coffee Subscription / US", "conv_id": 39, "conv_time": 1792467256, "counted": true, "identified": true, "recorded_amount": "32.00000", "touches": 1, "truncated": false }, { "amount": "125.00000", "campaign_name": "Holiday Gift Cards / AU", "conv_id": 41, "conv_time": 1792424376, "counted": true, "identified": true, "recorded_amount": "125.00000", "touches": 1, "truncated": false }, { "amount": "208.00000", "campaign_name": "Spring Collection / US", "conv_id": 30, "conv_time": 1792421176, "counted": true, "identified": true, "recorded_amount": "208.00000", "touches": 1, "truncated": false }, { "amount": "577.00000", "campaign_name": "Standing Desk Launch / UK", "conv_id": 52, "conv_time": 1792414880, "counted": true, "identified": true, "recorded_amount": "577.00000", "touches": 1, "truncated": false }, { "amount": "174.00000", "campaign_name": "Spring Collection / US", "conv_id": 35, "conv_time": 1792408826, "counted": true, "identified": true, "recorded_amount": "174.00000", "touches": 1, "truncated": false }, { "amount": "348.00000", "campaign_name": "Project Tool Pro Annual / US", "conv_id": 99, "conv_time": 1792362110, "counted": true, "identified": true, "recorded_amount": "348.00000", "touches": 1, "truncated": false }, { "amount": "29.00000", "campaign_name": "Free Trial to Paid / CA", "conv_id": 17, "conv_time": 1792347619, "counted": true, "identified": true, "recorded_amount": "29.00000", "touches": 1, "truncated": false }, { "amount": "348.00000", "campaign_name": "Project Tool Pro Annual / US", "conv_id": 12, "conv_time": 1792330333, "counted": true, "identified": true, "recorded_amount": "348.00000", "touches": 2, "truncated": false } ], "time_to_convert": { "1d_to_7d": 6, "1h_to_1d": 70, "7d_to_30d": 6, "over_30d": 0, "under_1h": 38 }, "truncated": 0, "unidentified": 0 }, "meta": { "backfill": null, "time_from": 1789963200, "time_to": 1792622304 } }
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, 6 no Pro licence on the install.
{
"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
}
]
}