p202 click update-cpc

Set what a set of past clicks cost (the UI's Update CPC), after counting them

Web UIUpdate › Update CPCNew in 1.9.77Writescannot be staged
All commands

01Jobs it does

Each one is a real command line. Copy it, or open it in the builder below to change it.

set what clicks cost

Also: record click cost

p202 click update-cpc --cpc <cpc> --from <from> --to <to>
Web UIUpdate › Update CPC

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 click update-cpc --from 2026-10-02 --to 2026-10-08 --cpc 0.40 --ppc-account-id 3 --dry-run
$ p202 click update-cpc --from 2026-10-02 --to 2026-10-08 --cpc 0.40 --ppc-account-id 3 --dry-run
aff_campaign_id:      Every campaign
aff_network_id:       Every category
cpc:                  0.40000
dry_run:              true
from:                 2026-10-02
landing_page_id:      Every landing page
matching:             307
method_of_promotion:  Direct links and landing pages
ppc_account_id:       Social Ads - Prospecting (3)
ppc_network_id:       Every traffic source
text_ad_id:           Every text ad
through_click_id:     2878
timezone:             America/New_York
to:                   2026-10-08
Dry run: 307 click(s) from 2026-10-02 to 2026-10-08 (America/New_York), traffic source account "Social Ads - Prospecting" (3) match; each would cost $0.40000. Nothing was written; drop --dry-run to update them (it asks first).
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 click update-cpc

Set flags below; the command updates as you type.

04Flags

12 flags, plus the global flags every command takes.

FlagWhat it does
--aff-campaign-idstringOnly this campaign's clicks (id from p202 campaign list; 0 = every campaign)
--aff-network-idstringOnly this category's clicks (id from p202 aff-network list; 0 = every category)
--cpcstringrequiredWhat each click cost, in dollars, up to 99.99999 with five decimals (required)
--dry-runboolCount the clicks and write nothing
--force, -fboolUpdate without asking (the count is still checked)
--fromstringrequiredFirst day, YYYY-MM-DD, in the account's time zone (required)
--landing-page-idstringOnly this landing page's clicks (id from p202 landing-page list; 0 = every landing page)
--method-of-promotionstringOnly direct-link or only landing-page clicks (default: both): directlink, landingpage
directlinklandingpage
--ppc-account-idstringOnly this traffic source account's clicks (id from p202 ppc-account list; 0 = every traffic source account)
--ppc-network-idstringOnly this traffic source's clicks (id from p202 ppc-network list; 0 = every traffic source)
--text-ad-idstringOnly this text ad's clicks (id from p202 text-ad list; 0 = every text ad)
--tostringrequiredLast day, YYYY-MM-DD, in the account's time zone (required)

05How it works

Sets the cost (CPC) of the account's clicks between --from 00:00:00 and --to 23:59:59 in the account's time zone, narrowed by any of the id filters and --method-of-promotion.

It counts the clicks first (POST /clicks/cpc?dry_run=1) and says how many, then asks (--force skips the question; --dry-run stops after the count). The update carries the count and the highest click id it saw, and the server writes only if those clicks still number the same — so a click recorded after the count is never changed, and when the selection moved nothing is written (exit 1; run the command again).

Needs a role with access_to_update_section and a key with clicks:write. Cannot be staged. Reports show the new cost once the data engine rebuilds the hours (its cron job).

06For agents

Running this from an agent

  • Read the same facts as JSON: p202 commands click update-cpc --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.
  • This command writes and cannot be staged: --staged is refused before anything is sent. Have a person run it, or give the agent a key without write scope.
p202 commands click update-cpc --json
{
  "path": "p202 click update-cpc",
  "use": "update-cpc",
  "short": "Set what a set of past clicks cost (the UI's Update CPC), after counting them",
  "long": "Sets the cost (CPC) of the account's clicks between --from 00:00:00 and --to 23:59:59 in\nthe account's time zone, narrowed by any of the id filters and --method-of-promotion.\n\nIt counts the clicks first (POST /clicks/cpc?dry_run=1) and says how many, then asks\n(--force skips the question; --dry-run stops after the count). The update carries the\ncount and the highest click id it saw, and the server writes only if those clicks still\nnumber the same — so a click recorded after the count is never changed, and when the\nselection moved nothing is written (exit 1; run the command again).\n\nNeeds a role with access_to_update_section and a key with clicks:write. Cannot be staged.\nReports show the new cost once the data engine rebuilds the hours (its cron job).",
  "runnable": true,
  "example": "p202 click update-cpc --from 2026-10-01 --to 2026-10-07 --cpc 0.25 --aff-campaign-id 12 --dry-run\n  p202 click update-cpc --from 2026-10-07 --to 2026-10-07 --cpc 0.00125 --ppc-account-id 3\n  p202 click update-cpc --from 2026-10-01 --to 2026-10-31 --cpc 1.10 --method-of-promotion directlink --force",
  "tasks": [
    {
      "run": "p202 click update-cpc",
      "ui_pages": [
        "Update › Update CPC"
      ],
      "phrases": [
        "set what clicks cost",
        "record click cost"
      ]
    }
  ],
  "flags": [
    {
      "name": "aff-campaign-id",
      "type": "string",
      "default": "",
      "usage": "Only this campaign's clicks (id from `p202 campaign list`; 0 = every campaign)",
      "required": false
    },
    {
      "name": "aff-network-id",
      "type": "string",
      "default": "",
      "usage": "Only this category's clicks (id from `p202 aff-network list`; 0 = every category)",
      "required": false
    },
    {
      "name": "cpc",
      "type": "string",
      "default": "",
      "usage": "What each click cost, in dollars, up to 99.99999 with five decimals (required)",
      "required": true
    },
    {
      "name": "dry-run",
      "type": "bool",
      "default": "false",
      "usage": "Count the clicks and write nothing",
      "required": false
    },
    {
      "name": "force",
      "shorthand": "f",
      "type": "bool",
      "default": "false",
      "usage": "Update without asking (the count is still checked)",
      "required": false
    },
    {
      "name": "from",
      "type": "string",
      "default": "",
      "usage": "First day, YYYY-MM-DD, in the account's time zone (required)",
      "required": true
    },
    {
      "name": "landing-page-id",
      "type": "string",
      "default": "",
      "usage": "Only this landing page's clicks (id from `p202 landing-page list`; 0 = every landing page)",
      "required": false
    },
    {
      "name": "method-of-promotion",
      "type": "string",
      "default": "",
      "usage": "Only direct-link or only landing-page clicks (default: both): directlink, landingpage",
      "allowed_values": [
        "directlink",
        "landingpage"
      ],
      "required": false
    },
    {
      "name": "ppc-account-id",
      "type": "string",
      "default": "",
      "usage": "Only this traffic source account's clicks (id from `p202 ppc-account list`; 0 = every traffic source account)",
      "required": false
    },
    {
      "name": "ppc-network-id",
      "type": "string",
      "default": "",
      "usage": "Only this traffic source's clicks (id from `p202 ppc-network list`; 0 = every traffic source)",
      "required": false
    },
    {
      "name": "text-ad-id",
      "type": "string",
      "default": "",
      "usage": "Only this text ad's clicks (id from `p202 text-ad list`; 0 = every text ad)",
      "required": false
    },
    {
      "name": "to",
      "type": "string",
      "default": "",
      "usage": "Last day, YYYY-MM-DD, in the account's time zone (required)",
      "required": true
    }
  ]
}