01Run it
Replace the <placeholders> with your own values, or use the builder below.
p202 report winners02What 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 report winners --breakdown keyword --period last30 id name Clicks Conversions Cost Profit Avg CPC bucket reason assisted_conversions first_touch_roi -- -------------------------- ------ ----------- ------ ------- ------- ------ ------------------------ -------------------- --------------- 4 height adjustable desk 64 3 70.40 1690.60 1.10 SCALE profit +$1690.60, 3 conv 0 2401.42 7 wrap dress midi 87 7 56.55 1071.45 0.65 SCALE profit +$1071.45, 7 conv 0 1894.69 15 linen shirt 148 7 63.54 918.46 0.4293 SCALE profit +$918.46, 7 conv 1 1445.48 20 digital gift card 54 5 25.92 599.08 0.48 SCALE profit +$599.08, 5 conv 0 2311.27 14 electric sit stand desk 64 2 70.40 595.60 1.10 SCALE profit +$595.60, 2 conv 0 846.02 9 team task tracker 47 2 112.80 583.20 2.40 SCALE profit +$583.20, 2 conv 0 517.02 5 last minute gift 52 4 24.96 525.04 0.48 SCALE profit +$525.04, 4 conv 0 2103.53 1 standing desk uk 62 1 68.20 508.80 1.10 SCALE profit +$508.80, 1 conv 0 746.04 10 wrap dress 156 2 66.90 271.10 0.4288 SCALE profit +$271.10, 2 conv 0 405.23 11 gantt chart tool 49 1 117.60 230.40 2.40 SCALE profit +$230.40, 1 conv 0 195.92 12 whole bean coffee delivery 70 6 26.60 191.40 0.38 SCALE profit +$191.40, 6 conv 0 719.55 6 spring collection 92 2 59.80 138.20 0.65 SCALE profit +$138.20, 2 conv 0 231.10 8 fresh roasted coffee 65 4 24.70 103.30 0.38 SCALE profit +$103.30, 4 conv 0 418.22 3 gift cards australia 54 1 25.92 99.08 0.48 SCALE profit +$99.08, 1 conv 0 382.25 18 linen shirt men 80 1 52 94 0.65 SCALE profit +$94.00, 1 conv 0 180.77 17 project tool free trial 59 6 106.20 67.80 1.80 SCALE profit +$67.80, 6 conv 0 63.84 16 coffee subscription 74 2 28.12 61.88 0.38 SCALE profit +$61.88, 2 conv 0 220.06 19 free project planner 51 4 91.80 24.20 1.80 SCALE profit +$24.20, 4 conv 0 26.36
$ p202 report winners --breakdown keyword --period last30 --json { "data": [ { "assisted_conversions": 0, "avg_cpc": 1.1, "bucket": "SCALE", "first_touch_roi": 2401.42, "id": 4, "name": "height adjustable desk", "reason": "profit +$1690.60, 3 conv", "total_clicks": 64, "total_cost": 70.4, "total_leads": 3, "total_net": 1690.6 }, { "assisted_conversions": 0, "avg_cpc": 0.65, "bucket": "SCALE", "first_touch_roi": 1894.69, "id": 7, "name": "wrap dress midi", "reason": "profit +$1071.45, 7 conv", "total_clicks": 87, "total_cost": 56.55, "total_leads": 7, "total_net": 1071.45 }, { "assisted_conversions": 1, "avg_cpc": 0.4293, "bucket": "SCALE", "first_touch_roi": 1445.48, "id": 15, "name": "linen shirt", "reason": "profit +$918.46, 7 conv", "total_clicks": 148, "total_cost": 63.54, "total_leads": 7, "total_net": 918.46 }, { "assisted_conversions": 0, "avg_cpc": 0.48, "bucket": "SCALE", "first_touch_roi": 2311.27, "id": 20, "name": "digital gift card", "reason": "profit +$599.08, 5 conv", "total_clicks": 54, "total_cost": 25.92, "total_leads": 5, "total_net": 599.08 }, { "assisted_conversions": 0, "avg_cpc": 1.1, "bucket": "SCALE", "first_touch_roi": 846.02, "id": 14, "name": "electric sit stand desk", "reason": "profit +$595.60, 2 conv", "total_clicks": 64, "total_cost": 70.4, "total_leads": 2, "total_net": 595.6 }, { "assisted_conversions": 0, "avg_cpc": 2.4, "bucket": "SCALE", "first_touch_roi": 517.02, "id": 9, "name": "team task tracker", "reason": "profit +$583.20, 2 conv", "total_clicks": 47, "total_cost": 112.8, "total_leads": 2, "total_net": 583.2 }, { "assisted_conversions": 0, "avg_cpc": 0.48, "bucket": "SCALE", "first_touch_roi": 2103.53, "id": 5, "name": "last minute gift", "reason": "profit +$525.04, 4 conv", "total_clicks": 52, "total_cost": 24.96, "total_leads": 4, "total_net": 525.04 }, { "assisted_conversions": 0, "avg_cpc": 1.1, "bucket": "SCALE", "first_touch_roi": 746.04, "id": 1, "name": "standing desk uk", "reason": "profit +$508.80, 1 conv", "total_clicks": 62, "total_cost": 68.2, "total_leads": 1, "total_net": 508.8 }, { "assisted_conversions": 0, "avg_cpc": 0.4288, "bucket": "SCALE", "first_touch_roi": 405.23, "id": 10, "name": "wrap dress", "reason": "profit +$271.10, 2 conv", "total_clicks": 156, "total_cost": 66.9, "total_leads": 2, "total_net": 271.1 }, { "assisted_conversions": 0, "avg_cpc": 2.4, "bucket": "SCALE", "first_touch_roi": 195.92, "id": 11, "name": "gantt chart tool", "reason": "profit +$230.40, 1 conv", "total_clicks": 49, "total_cost": 117.6, "total_leads": 1, "total_net": 230.4 }, { "assisted_conversions": 0, "avg_cpc": 0.38, "bucket": "SCALE", "first_touch_roi": 719.55, "id": 12, "name": "whole bean coffee delivery", "reason": "profit +$191.40, 6 conv", "total_clicks": 70, "total_cost": 26.6, "total_leads": 6, "total_net": 191.4 }, { "assisted_conversions": 0, "avg_cpc": 0.65, "bucket": "SCALE", "first_touch_roi": 231.1, "id": 6, "name": "spring collection", "reason": "profit +$138.20, 2 conv", "total_clicks": 92, "total_cost": 59.8, "total_leads": 2, "total_net": 138.2 }, { "assisted_conversions": 0, "avg_cpc": 0.38, "bucket": "SCALE", "first_touch_roi": 418.22, "id": 8, "name": "fresh roasted coffee", "reason": "profit +$103.30, 4 conv", "total_clicks": 65, "total_cost": 24.7, "total_leads": 4, "total_net": 103.3 }, { "assisted_conversions": 0, "avg_cpc": 0.48, "bucket": "SCALE", "first_touch_roi": 382.25, "id": 3, "name": "gift cards australia", "reason": "profit +$99.08, 1 conv", "total_clicks": 54, "total_cost": 25.92, "total_leads": 1, "total_net": 99.08 }, { "assisted_conversions": 0, "avg_cpc": 0.65, "bucket": "SCALE", "first_touch_roi": 180.77, "id": 18, "name": "linen shirt men", "reason": "profit +$94.00, 1 conv", "total_clicks": 80, "total_cost": 52, "total_leads": 1, "total_net": 94 }, { "assisted_conversions": 0, "avg_cpc": 1.8, "bucket": "SCALE", "first_touch_roi": 63.84, "id": 17, "name": "project tool free trial", "reason": "profit +$67.80, 6 conv", "total_clicks": 59, "total_cost": 106.2, "total_leads": 6, "total_net": 67.8 }, { "assisted_conversions": 0, "avg_cpc": 0.38, "bucket": "SCALE", "first_touch_roi": 220.06, "id": 16, "name": "coffee subscription", "reason": "profit +$61.88, 2 conv", "total_clicks": 74, "total_cost": 28.12, "total_leads": 2, "total_net": 61.88 }, { "assisted_conversions": 0, "avg_cpc": 1.8, "bucket": "SCALE", "first_touch_roi": 26.36, "id": 19, "name": "free project planner", "reason": "profit +$24.20, 4 conv", "total_clicks": 51, "total_cost": 91.8, "total_leads": 4, "total_net": 24.2 } ] }
Profit by keyword
Drawn from the JSON output above.
03Build your command
Pick values and the command line writes itself, quoted and ready to paste.
p202 report winnersSet flags below; the command updates as you type.
04Flags
26 flags, plus the global flags every command takes.
| Flag | What it does |
|---|---|
| --aff-campaign-idstring | Filter by INTERNAL campaign id (from campaign list), not the public id in tracking URLs |
| --aff-network-idstring | Filter by affiliate network ID |
| --breakdown, -bstring · default keyword | Dimension to triage: campaign, aff_network, ppc_account, ppc_network, landing_page, keyword, country, city, region, browser, platform, device, isp, text_ad, ip, referer, referer_url, device_type, c1, c2, c3, c4, utm_source, utm_medium, utm_campaign, utm_term, utm_content, rotator, rotator_rule (aliases: geo=country, lp=landing_page, network=aff_network, offer=campaign, referrer=referer, referrer_url=referer_url, rule=rotator_rule, source=ppc_account)campaignaff_networkppc_accountppc_networklanding_pagekeywordcountrycityregionbrowserplatformdeviceisptext_adiprefererreferer_urldevice_typec1c2c3c4utm_sourceutm_mediumutm_campaignutm_termutm_contentrotatorrotator_rulegeo → countrylp → landing_pagenetwork → aff_networkoffer → campaignreferrer → refererreferrer_url → referer_urlrule → rotator_rulesource → ppc_account |
| --browser-idstring | Filter by browser ID (the id of a --breakdown browser row) |
| --country-idstring | Filter by country ID |
| --device-typestring | Filter by device type ID: 1 Desktop, 2 Mobile, 3 Tablet, 4 Bot (the ids of --breakdown device_type rows) |
| --first-touch-modelstring | Attribution model id for the closer check (default: the first active First touch model) |
| --ipstring | Only clicks from this one IP address, IPv4 or IPv6 |
| --isp-idstring | Filter by ISP/carrier ID (the id of a --breakdown isp row) |
| --keywordstring | Only clicks whose keyword contains this text (case-insensitive) |
| --landing-page-idstring | Filter by landing page ID |
| --max-cpcfloat64 | Break-even CPC target (else payout × each row's CVR, from --payout or the campaign) |
| --method-of-promotionstring | Only direct-link clicks or only landing-page clicks: directlink, landingpagedirectlinklandingpage |
| --min-clicksfloat64 · default 1 | Ignore rows with fewer than N clicks (significance floor) |
| --no-attribution-checkbool | List classic last-click winners only, without the first-touch closer check |
| --payoutfloat64 | Revenue per conversion, e.g. your average order value: each row's break-even CPC is this × its conversion rate, and its profit (total_net) and first-touch ROI value each sale at this. Unlike --aff-campaign-id it doesn't filter the report, so the attribution check still runs |
| --period, -pstring | Period: today, yesterday, last7, last14, last30, last90, thismonth, lastmonth, thisyear, lastyear, alltimetodayyesterdaylast7last14last30last90thismonthlastmonththisyearlastyearalltime |
| --platform-idstring | Filter by platform (OS) ID (the id of a --breakdown platform row) |
| --ppc-account-idstring | Filter by PPC account ID |
| --ppc-network-idstring | Filter by PPC network ID, or none for the clicks with no traffic source |
| --refererstring | Only clicks whose referring URL contains this text (case-insensitive) |
| --region-idstring | Filter by region ID (the id of a --breakdown region row) |
| --showstring | Which clicks count (default all): all, real, filtered, filtered_bot, leads; real = not filtered, filtered_bot = filtered as bots, leads = convertedallrealfilteredfiltered_botleads |
| --text-ad-idstring | Filter by text ad ID |
| --time-fromstring | 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 | End, inclusive: unix seconds, a date (2026-10-01, through its last second in the account's timezone) or a time with its offset |
05How it works
Rows to SCALE from the classic (last-click) report: profitable and converting. Profit is the campaign's recorded income less cost, or with --payout (your revenue per conversion) sales × payout less cost, the value the first-touch ROI below then uses too. Sales are counted with the Last touch model where the check can read it (a converted click can have several), so a source profitable only through repeat sales is listed too.
Each SCALE row is then checked against the attribution report under a first-touch model, for the same dimension and range. A row that loses money under first touch comes back as CLOSER, with its first-touch ROI and assists: last-click credits it with sales other rows started (retargeting, brand search and email often look like this), so more budget won't bring more new buyers. Check what feeds it before scaling.
The check runs for campaign, ppc_account (traffic source), landing_page, keyword and country, and needs a First touch model (the first active one, or --first-touch-model) and an attribution:read key. When it can't run, the classic winners are still listed with the reason on stderr. A filter other than the breakdown itself (an entity id, --keyword, --show, ...) turns it off; --no-attribution-check does too.
06For agents
Running this from an agent
- Read the same facts as JSON:
p202 commands report winners --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 report winners",
"use": "winners",
"short": "Rows to SCALE: profitable, converting keywords/geos; closers come back as CLOSER",
"long": "Rows to SCALE from the classic (last-click) report: profitable and converting. Profit is the campaign's\nrecorded income less cost, or with --payout (your revenue per conversion) sales × payout less cost, the value the\nfirst-touch ROI below then uses too. Sales are counted with the Last touch model where the check can read it\n(a converted click can have several), so a source profitable only through repeat sales is listed too.\n\nEach SCALE row is then checked against the attribution report under a first-touch model, for the same dimension\nand range. A row that loses money under first touch comes back as CLOSER, with its first-touch ROI and assists:\nlast-click credits it with sales other rows started (retargeting, brand search and email often look like this),\nso more budget won't bring more new buyers. Check what feeds it before scaling.\n\nThe check runs for campaign, ppc_account (traffic source), landing_page, keyword and country, and needs a First\ntouch model (the first active one, or --first-touch-model) and an attribution:read key. When it can't run, the\nclassic winners are still listed with the reason on stderr. A filter other than the breakdown itself (an entity\nid, --keyword, --show, ...) turns it off; --no-attribution-check does too.",
"runnable": true,
"flags": [
{
"name": "aff-campaign-id",
"type": "string",
"default": "",
"usage": "Filter by INTERNAL campaign id (from `campaign list`), not the public id in tracking URLs",
"required": false
},
{
"name": "aff-network-id",
"type": "string",
"default": "",
"usage": "Filter by affiliate network ID",
"required": false
},
{
"name": "breakdown",
"shorthand": "b",
"type": "string",
"default": "keyword",
"usage": "Dimension to triage: campaign, aff_network, ppc_account, ppc_network, landing_page, keyword, country, city, region, browser, platform, device, isp, text_ad, ip, referer, referer_url, device_type, c1, c2, c3, c4, utm_source, utm_medium, utm_campaign, utm_term, utm_content, rotator, rotator_rule (aliases: geo=country, lp=landing_page, network=aff_network, offer=campaign, referrer=referer, referrer_url=referer_url, rule=rotator_rule, source=ppc_account)",
"allowed_values": [
"campaign",
"aff_network",
"ppc_account",
"ppc_network",
"landing_page",
"keyword",
"country",
"city",
"region",
"browser",
"platform",
"device",
"isp",
"text_ad",
"ip",
"referer",
"referer_url",
"device_type",
"c1",
"c2",
"c3",
"c4",
"utm_source",
"utm_medium",
"utm_campaign",
"utm_term",
"utm_content",
"rotator",
"rotator_rule"
],
"value_aliases": {
"geo": "country",
"lp": "landing_page",
"network": "aff_network",
"offer": "campaign",
"referrer": "referer",
"referrer_url": "referer_url",
"rule": "rotator_rule",
"source": "ppc_account"
},
"required": false
},
{
"name": "browser-id",
"type": "string",
"default": "",
"usage": "Filter by browser ID (the id of a `--breakdown browser` row)",
"required": false
},
{
"name": "country-id",
"type": "string",
"default": "",
"usage": "Filter by country ID",
"required": false
},
{
"name": "device-type",
"type": "string",
"default": "",
"usage": "Filter by device type ID: 1 Desktop, 2 Mobile, 3 Tablet, 4 Bot (the ids of `--breakdown device_type` rows)",
"required": false
},
{
"name": "first-touch-model",
"type": "string",
"default": "",
"usage": "Attribution model id for the closer check (default: the first active First touch model)",
"required": false
},
{
"name": "ip",
"type": "string",
"default": "",
"usage": "Only clicks from this one IP address, IPv4 or IPv6",
"required": false
},
{
"name": "isp-id",
"type": "string",
"default": "",
"usage": "Filter by ISP/carrier ID (the id of a `--breakdown isp` row)",
"required": false
},
{
"name": "keyword",
"type": "string",
"default": "",
"usage": "Only clicks whose keyword contains this text (case-insensitive)",
"required": false
},
{
"name": "landing-page-id",
"type": "string",
"default": "",
"usage": "Filter by landing page ID",
"required": false
},
{
"name": "max-cpc",
"type": "float64",
"default": "0",
"usage": "Break-even CPC target (else payout × each row's CVR, from --payout or the campaign)",
"required": false
},
{
"name": "method-of-promotion",
"type": "string",
"default": "",
"usage": "Only direct-link clicks or only landing-page clicks: directlink, landingpage",
"allowed_values": [
"directlink",
"landingpage"
],
"required": false
},
{
"name": "min-clicks",
"type": "float64",
"default": "1",
"usage": "Ignore rows with fewer than N clicks (significance floor)",
"required": false
},
{
"name": "no-attribution-check",
"type": "bool",
"default": "false",
"usage": "List classic last-click winners only, without the first-touch closer check",
"required": false
},
{
"name": "payout",
"type": "float64",
"default": "0",
"usage": "Revenue per conversion, e.g. your average order value: each row's break-even CPC is this × its conversion rate, and its profit (total_net) and first-touch ROI value each sale at this. Unlike --aff-campaign-id it doesn't filter the report, so the attribution check still runs",
"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": "platform-id",
"type": "string",
"default": "",
"usage": "Filter by platform (OS) ID (the id of a `--breakdown platform` row)",
"required": false
},
{
"name": "ppc-account-id",
"type": "string",
"default": "",
"usage": "Filter by PPC account ID",
"required": false
},
{
"name": "ppc-network-id",
"type": "string",
"default": "",
"usage": "Filter by PPC network ID, or none for the clicks with no traffic source",
"required": false
},
{
"name": "referer",
"type": "string",
"default": "",
"usage": "Only clicks whose referring URL contains this text (case-insensitive)",
"required": false
},
{
"name": "region-id",
"type": "string",
"default": "",
"usage": "Filter by region ID (the id of a `--breakdown region` row)",
"required": false
},
{
"name": "show",
"type": "string",
"default": "",
"usage": "Which clicks count (default all): all, real, filtered, filtered_bot, leads; real = not filtered, filtered_bot = filtered as bots, leads = converted",
"allowed_values": [
"all",
"real",
"filtered",
"filtered_bot",
"leads"
],
"required": false
},
{
"name": "text-ad-id",
"type": "string",
"default": "",
"usage": "Filter by text ad ID",
"required": false
},
{
"name": "time-from",
"type": "string",
"default": "",
"usage": "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": "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
}
]
}