01Jobs it does
Each one is a real command line. Copy it, or open it in the builder below to change it.
postback url
Also: s2s postback, server to server postback
p202 conversion postback-url02What 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 conversion postback-url https://track.example.com/tracking202/static/gpb.php?amount=&subid= Server-to-server postback URL, simple (give this to your network): subid= is empty: put your network's sub id macro after it, or rerun with --subid. If the network only supports sid, change ?subid= to ?sid=.
$ p202 conversion postback-url --json { "data": { "advanced": { "pixel": "\u003cimg height=\"1\" width=\"1\" border=\"0\" style=\"display: none;\" src=\"https://track.example.com/tracking202/static/gpx.php?amount=\u0026cid=\u0026subid=\" /\u003e", "postback_url": "https://track.example.com/tracking202/static/gpb.php?amount=\u0026cid=\u0026subid=" }, "amount": "", "base_url": "https://track.example.com/tracking202/static/", "campaign_id": null, "scheme": "http", "simple": { "pixel": "\u003cimg height=\"1\" width=\"1\" border=\"0\" style=\"display: none;\" src=\"https://track.example.com/tracking202/static/gpx.php?amount=\u0026subid=\" /\u003e", "postback_url": "https://track.example.com/tracking202/static/gpb.php?amount=\u0026subid=" }, "subid": "", "universal": { "iframe": "\u003ciframe height=\"1\" width=\"1\" border=\"0\" style=\"display: none;\" frameborder=\"0\" scrolling=\"no\" src=\"https://track.example.com/tracking202/static/upx.php?amount=\u0026subid=\" seamless\u003e\u003c/iframe\u003e", "javascript": "\u003cscript\u003e\n var vars202={amount:\"\",cid:\"\",subid:\"\"};(function(d, s) {\n \tvar js, upxf = d.getElementsByTagName(s)[0], load = function(url, id) {\n \t\tif (d.getElementById(id)) {return;}\n \t\tif202 = d.createElement(\"iframe\");if202.src = url;if202.id = id;if202.height = 1;if202.width = 0;if202.frameBorder = 1;if202.scrolling = \"no\";if202.noResize = true;\n \t\tupxf.parentNode.insertBefore(if202, upxf);\n \t};\n \tload(\"https://track.example.com/tracking202/static/upx.php?amount=\"+vars202['amount']+\"\u0026cid=\"+vars202['cid']+\"\u0026subid=\"+vars202['subid'], \"upxif\");\n }(document, \"script\"));\u003c/script\u003e\n\u003cnoscript\u003e\n \t\u003ciframe height=\"1\" width=\"1\" border=\"0\" style=\"display: none;\" frameborder=\"0\" scrolling=\"no\" src=\"https://track.example.com/tracking202/static/upx.php?amount=\u0026cid=\u0026subid=\" seamless\u003e\u003c/iframe\u003e\n\u003c/noscript\u003e" } } }
03Build your command
Pick values and the command line writes itself, quoted and ready to paste.
p202 conversion postback-urlSet flags below; the command updates as you type.
04Flags
5 flags, plus the global flags every command takes.
| Flag | What it does |
|---|---|
| --amountstring | Amount: a number, or your network's payout macro such as {payout}; empty pays the campaign's payout |
| --campaignstring | Campaign ID the advanced pixel reports under (fills cid; from p202 campaign list) |
| --schemestring | http or https (default: the scheme the tracking domain is reached on): http, httpshttphttps |
| --subidstring | Your network's sub id macro, such as {aff_sub}, #s1#, xxC1xx or [=SID=]; empty leaves subid= for you to fill |
| --typestring | Pixel type: simple, advanced (default simple; advanced when --campaign is given): simple, advancedsimpleadvanced |
05How it works
Prints the postback URL Setup > Postback / Pixel shows: gpb.php on this install's tracking domain, which the network calls with the conversion's sub id (and amount).
--subid the network's sub id macro, e.g. {aff_sub} (HasOffers), #s2# (Cake) --amount a number or the network's payout macro, e.g. {payout}; empty pays the campaign's payout --campaign <id> the advanced postback, which also carries cid
Stdout is the URL alone, under --quiet too; --json prints every pixel and postback the page shows. If the network only supports sid, change ?subid= to ?sid=. Needs a role with access_to_setup_section.
06For agents
Running this from an agent
- Read the same facts as JSON:
p202 commands conversion postback-url --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 conversion postback-url",
"use": "postback-url",
"short": "Print the server-to-server postback URL to give your affiliate network (Setup > Postback / Pixel)",
"long": "Prints the postback URL Setup > Postback / Pixel shows: gpb.php on this install's\ntracking domain, which the network calls with the conversion's sub id (and amount).\n\n --subid the network's sub id macro, e.g. {aff_sub} (HasOffers), #s2# (Cake)\n --amount a number or the network's payout macro, e.g. {payout}; empty pays the\n campaign's payout\n --campaign <id> the advanced postback, which also carries cid\n\nStdout is the URL alone, under --quiet too; --json prints every pixel and postback\nthe page shows.\nIf the network only supports sid, change ?subid= to ?sid=. Needs a role with\naccess_to_setup_section.",
"runnable": true,
"example": "p202 conversion postback-url --subid '{aff_sub}' --amount '{payout}'\n p202 conversion postback-url --campaign 3 --subid '#s2#'",
"tasks": [
{
"run": "p202 conversion postback-url",
"ui_pages": [
"Setup › Postback/Pixel"
],
"phrases": [
"postback url",
"s2s postback",
"server to server postback"
]
}
],
"flags": [
{
"name": "amount",
"type": "string",
"default": "",
"usage": "Amount: a number, or your network's payout macro such as {payout}; empty pays the campaign's payout",
"required": false
},
{
"name": "campaign",
"type": "string",
"default": "",
"usage": "Campaign ID the advanced pixel reports under (fills cid; from p202 campaign list)",
"required": false
},
{
"name": "scheme",
"type": "string",
"default": "",
"usage": "http or https (default: the scheme the tracking domain is reached on): http, https",
"allowed_values": [
"http",
"https"
],
"required": false
},
{
"name": "subid",
"type": "string",
"default": "",
"usage": "Your network's sub id macro, such as {aff_sub}, #s1#, xxC1xx or [=SID=]; empty leaves subid= for you to fill",
"required": false
},
{
"name": "type",
"type": "string",
"default": "",
"usage": "Pixel type: simple, advanced (default simple; advanced when --campaign is given): simple, advanced",
"allowed_values": [
"simple",
"advanced"
],
"required": false
}
]
}