p202 attribution model create

Create an attribution model; its credits are computed for existing conversions by the next worker run

Writessupports --staged
All commands

01Run it

Replace the <placeholders> with your own values, or use the builder below.

p202 attribution model create --model-name <model_name> --model-type <model_type>

02What you get

Pick the shape you need. People get a table. Add --json, --csv or --ndjson for scripts, or -q for ids only. An AI agent gets compact JSON without asking. All output formats

03Build your command

Pick values and the command line writes itself, quoted and ready to paste.

p202 attribution model create

Set flags below; the command updates as you type.

04Flags

7 flags, plus the global flags every command takes.

FlagWhat it does
--defaultboolMake this the account default model
--idempotency-keystringRetry-safe create: the server records the response under this key and replays it on a retry with the same key and payload instead of creating a duplicate
--lookback-daysint ยท default 30Days before a conversion whose clicks can earn credit, 1-365
--model-namestringrequiredModel name (required)
--model-typestringrequiredType (required): last_touch, first_touch, linear, time_decay, position_based
last_touchfirst_touchlineartime_decayposition_based
--statusstringStatus: active, inactive
activeinactive
--weighting-configstringWeighting config JSON object: time_decay {"half_life_hours":48}, position_based {"first_weight":0.4,"last_weight":0.4}

05For agents

Running this from an agent

  • Read the same facts as JSON: p202 commands attribution model create --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. Add --staged to record it as a proposal a person applies with p202 change apply.
p202 commands attribution model create --json
{
  "path": "p202 attribution model create",
  "use": "create",
  "short": "Create an attribution model; its credits are computed for existing conversions by the next worker run",
  "runnable": true,
  "flags": [
    {
      "name": "default",
      "type": "bool",
      "default": "false",
      "usage": "Make this the account default model",
      "required": false
    },
    {
      "name": "idempotency-key",
      "type": "string",
      "default": "",
      "usage": "Retry-safe create: the server records the response under this key and replays it on a retry with the same key and payload instead of creating a duplicate",
      "required": false
    },
    {
      "name": "lookback-days",
      "type": "int",
      "default": "30",
      "usage": "Days before a conversion whose clicks can earn credit, 1-365",
      "required": false
    },
    {
      "name": "model-name",
      "type": "string",
      "default": "",
      "usage": "Model name (required)",
      "required": true
    },
    {
      "name": "model-type",
      "type": "string",
      "default": "",
      "usage": "Type (required): last_touch, first_touch, linear, time_decay, position_based",
      "allowed_values": [
        "last_touch",
        "first_touch",
        "linear",
        "time_decay",
        "position_based"
      ],
      "required": true
    },
    {
      "name": "status",
      "type": "string",
      "default": "",
      "usage": "Status: active, inactive",
      "allowed_values": [
        "active",
        "inactive"
      ],
      "required": false
    },
    {
      "name": "weighting-config",
      "type": "string",
      "default": "",
      "usage": "Weighting config JSON object: time_decay {\"half_life_hours\":48}, position_based {\"first_weight\":0.4,\"last_weight\":0.4}",
      "required": false
    }
  ]
}