Conversion pixel engine (Marty approved 2026-10-23): goals with public pixel ids, click ids on every ad click (lsclk, 'a'+11 hex), spin links pass the ad click on, landing tag /t.js + goal pixel /cv.gif /cv.js matching url > stored > cookie > 24 h soft key, once per click, 30-day window, owner check, rate limits, goal postbacks (event 'goal'), member + signed partner APIs for InstantAdPay

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-23 18:10:46 -05:00
parent ff8b8abc77
commit dd2244272b
7 changed files with 477 additions and 14 deletions
+2 -2
View File
@@ -116,11 +116,11 @@ async function seen(impId, req) {
}
J.save(); return { ok: true };
}
async function click(impId) {
async function click(impId, decorate) { // decorate(campaignId, url) -> url: the conversion pixel's click id (2026-10-23)
const imp = J.db.imps.find(i => i.id === String(impId)); if (!imp) return null;
imp.k = 1; J.save();
if (imp.house || !imp.camp) return 'https://' + siteHost + '/';
try { return (await ads.click(imp.camp)) || ('https://' + siteHost + '/'); } catch (e) { return 'https://' + siteHost + '/'; }
try { const url = await ads.click(imp.camp); if (!url) return 'https://' + siteHost + '/'; return decorate ? ((await decorate(imp.camp, url).catch(() => url)) || url) : url; } catch (e) { return 'https://' + siteHost + '/'; }
}
// -- admin: every zone with its owner, site, mix and status; pause/resume
async function adminList() { return J.db.zones.map(z => Object.assign(pubZone(z), { owner: z.owner, note: z.adminNote || '' })).sort((a, b) => b.views30 - a.views30); }