Network sites as LinkSpin traffic sources (Marty 2026-11-14: "Make sure each of these sites is its own traffic source and link spun so we can track it"). Catalog: InstantAdPay, LinkSpin, Stack POL, Earners Corner network templates (next to Downline Banners and Viral Banner Blitz). A spin-link click with ?src=<site id> (iap, linkspin, dlb, vbb, stackpol, earnerscorner) counts under the link owner's source for that site, made from the template on first use (network templates only, no postback, so no network hears of a click it did not send; no referrer = the site's name as referrer). netlinks.js: at boot the admin account gets one fixed network link per site, made once when missing: nwiap, nwls, nwdlb, nwvbb, nwsp, nwec -> https://<site>/{s2}?ref={s1} (Earners Corner without ref), so every site links to the others as linkspin.app/r/<code>?src=<sender>&s1=<member>&s2=<page>. Health checks probe a destination with its {macros} empty, as a click with no params lands. netsites.js: /api/network-sites adds go (the tracked link with ?src=linkspin); common.js + netline.js footers use it (rel nofollow). common.js?v=20261114ns, netline.js?v=20261114ns. qa: netsrc 16/16 (new, bash qa/run.sh netsrc), member 57 passed 0 failed, partner-spins 13/13, netconv 57/57, lsid 31/31

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-14 11:39:34 -06:00
parent 9025057128
commit a630979a3a
35 changed files with 226 additions and 39 deletions
+13 -1
View File
@@ -138,6 +138,18 @@ function forFire(owner, id) { const s = find(owner, id); return s && s.enabled &
function save() { J.save(); }
// name + placement key per source, for rotator.summary
function meta(owner) { const m = {}; for (const s of mine(owner)) m[s.id] = { name: s.name, placementKey: placementKey(s), site: s.site || '' }; return m; }
// network sites as traffic sources (Marty 2026-11-14: "make sure each of these sites is its own traffic source"): a spin-link click
// carrying ?src=<site id> (iap, linkspin, dlb, vbb, stackpol, earnerscorner, or the catalog key) counts under the link owner's
// source for that site, made from the network catalog template the first time it is needed. Only network templates qualify.
const NET_SRC = { iap: 'instantadpay', instantadpay: 'instantadpay', linkspin: 'linkspin', dlb: 'downlinebanners', downlinebanners: 'downlinebanners',
vbb: 'viralbannerblitz', viralbannerblitz: 'viralbannerblitz', stackpol: 'stackpol', earnerscorner: 'earnerscorner' };
function networkTemplate(src) { const k = NET_SRC[String(src || '').trim().toLowerCase()]; const t = k ? template(k) : null; return t && t.source === 'network' ? t : null; }
function networkSource(owner, src) {
const t = networkTemplate(src); if (!t || !owner) return null;
let s = J.db.items.find(x => x.owner === norm(owner) && x.template === t.key);
if (!s) { create(owner, { template: t.key, name: t.name, site: t.site }); s = J.db.items.find(x => x.owner === norm(owner) && x.template === t.key); } // create() runs to the end synchronously (no awaits)
return s ? { id: s.id, site: t.site } : null;
}
// admin Member content (2026-10-18): every source of every owner
function adminAll() { return J.db.items.map(s => Object.assign(pub(s), { owner: s.owner })); }
module.exports = { init, adminAll, catalog, list, create, update, get, urlFor, test, find, forFire, save, meta, KEYS, PLACEMENT_KEYS, LIMITS };
module.exports = { init, adminAll, networkSource, networkTemplate, NET_SRC, catalog, list, create, update, get, urlFor, test, find, forFire, save, meta, KEYS, PLACEMENT_KEYS, LIMITS };