p202 conversion offline-export

Conversions as Google Ads' or Microsoft Advertising's offline conversion import CSV

Web UISetup › Offline ConversionsNew in 1.9.79
All commands

01Jobs it does

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

offline conversions csv

Also: google ads offline conversions, upload conversions to google ads, gclid upload, microsoft ads offline conversions, msclkid upload, bing offline conversions, scheduled conversion upload

p202 conversion offline-export --format google
Web UISetup › Offline Conversions

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 conversion offline-export

Set flags below; the command updates as you type.

04Flags

8 flags, plus the global flags every command takes.

FlagWhat it does
--ad-personalizationstringGoogle's Ad Personalization column on every line: granted, denied
granteddenied
--ad-user-datastringGoogle's Ad User Data column on every line, as your consent banner collected it: granted, denied
granteddenied
--aff-campaign-idstringOnly this campaign's conversions (an id from p202 campaign list)
--conversion-namestringSend every conversion under this conversion action (Google) or goal (Microsoft) name
--daysstringConversions from the last this many days, 1 to 90 (default 90)
--formatstringThe import file: google, google_uploads, microsoft
googlegoogle_uploadsmicrosoft
--outputstringWrite the file here instead of to stdout
--summaryboolPrint how many conversions the file holds and why each other one is left out, instead of the file

05How it works

Writes the account's conversions as an ad platform's offline conversion import file, for Google Ads (--format google: Data Manager, gclid, gbraid and wbraid; google_uploads: the Uploads template, gclid) or Microsoft Advertising (--format microsoft: msclkid). Only conversions whose click was named (by the postback, pixel, API call, upload or a tracking cookie) are in it, at the value they count for in the account's currency, under each campaign's conversion name (set on Setup › Offline Conversions; --conversion-name names every line). --summary says how many conversions the file holds and why each other one is left out. A schedule that fetches the file by itself is a fetch URL made on that Setup page.

p202 conversion offline-export --format google --output google-ads.csv
p202 conversion offline-export --format microsoft --days 7 --summary

06For agents

Running this from an agent

  • Read the same facts as JSON: p202 commands conversion offline-export --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, 6 no Pro licence on the install.
p202 commands conversion offline-export --json
{
  "path": "p202 conversion offline-export",
  "use": "offline-export",
  "short": "Conversions as Google Ads' or Microsoft Advertising's offline conversion import CSV",
  "long": "Writes the account's conversions as an ad platform's offline conversion import file, for Google\nAds (--format google: Data Manager, gclid, gbraid and wbraid; google_uploads: the Uploads\ntemplate, gclid) or Microsoft Advertising (--format microsoft: msclkid). Only conversions whose\nclick was named (by the postback, pixel, API call, upload or a tracking cookie) are in it, at the\nvalue they count for in the account's currency, under each campaign's conversion name (set on\nSetup › Offline Conversions; --conversion-name names every line). --summary says how many\nconversions the file holds and why each other one is left out. A schedule that fetches the file\nby itself is a fetch URL made on that Setup page.\n\n  p202 conversion offline-export --format google --output google-ads.csv\n  p202 conversion offline-export --format microsoft --days 7 --summary",
  "runnable": true,
  "tasks": [
    {
      "run": "p202 conversion offline-export --format google",
      "ui_pages": [
        "Setup › Offline Conversions"
      ],
      "phrases": [
        "offline conversions csv",
        "google ads offline conversions",
        "upload conversions to google ads",
        "gclid upload",
        "microsoft ads offline conversions",
        "msclkid upload",
        "bing offline conversions",
        "scheduled conversion upload"
      ]
    }
  ],
  "flags": [
    {
      "name": "ad-personalization",
      "type": "string",
      "default": "",
      "usage": "Google's Ad Personalization column on every line: granted, denied",
      "allowed_values": [
        "granted",
        "denied"
      ],
      "required": false
    },
    {
      "name": "ad-user-data",
      "type": "string",
      "default": "",
      "usage": "Google's Ad User Data column on every line, as your consent banner collected it: granted, denied",
      "allowed_values": [
        "granted",
        "denied"
      ],
      "required": false
    },
    {
      "name": "aff-campaign-id",
      "type": "string",
      "default": "",
      "usage": "Only this campaign's conversions (an id from `p202 campaign list`)",
      "required": false
    },
    {
      "name": "conversion-name",
      "type": "string",
      "default": "",
      "usage": "Send every conversion under this conversion action (Google) or goal (Microsoft) name",
      "required": false
    },
    {
      "name": "days",
      "type": "string",
      "default": "",
      "usage": "Conversions from the last this many days, 1 to 90 (default 90)",
      "required": false
    },
    {
      "name": "format",
      "type": "string",
      "default": "",
      "usage": "The import file: google, google_uploads, microsoft",
      "allowed_values": [
        "google",
        "google_uploads",
        "microsoft"
      ],
      "required": false
    },
    {
      "name": "output",
      "type": "string",
      "default": "",
      "usage": "Write the file here instead of to stdout",
      "required": false
    },
    {
      "name": "summary",
      "type": "bool",
      "default": "false",
      "usage": "Print how many conversions the file holds and why each other one is left out, instead of the file",
      "required": false
    }
  ]
}