diff --git a/public/assets/my.js b/public/assets/my.js index 500efb3..bacafe0 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -40,7 +40,7 @@ const head = kind === 'spot' ? '
Spot #' + s.id + '' + esc(KIND[s.kind] || '') + ' · ' + s.views + ' of ' + s.owed + ' views' + (s.kind === 3 ? '' : s.delivering ? ' · ' + s.daysLeft + ' days left' : ' · delivery finished') + ' · clicks ' + (s.clicks.organic + s.clicks.gate) + '
' : ''; el.innerHTML = head + '
' - + '
' + + '
Tracking: {clickid}, {spot} and {type} in your link are filled on every click (LinkSpin has a Downline Banners source ready for this).
' + '
' + '
'; const prev = el.querySelector('.lots'); prev.appendChild(BL.tile({ t: 'x', img: (s.showing && s.showing.img) || '/art/house-line.svg', href: s.link || '#' })); diff --git a/public/my.html b/public/my.html index 804e840..05778e7 100644 --- a/public/my.html +++ b/public/my.html @@ -28,6 +28,6 @@ - + diff --git a/server.js b/server.js index 7b17f33..cf99633 100644 --- a/server.js +++ b/server.js @@ -203,12 +203,17 @@ const server = http.createServer(async (req, res) => { if (/^\/go\/[\w-]+$/.test(p)) { const ref = p.slice(4); const t = board.target(ref); if (!t) { res.writeHead(302, { Location: '/' }); return res.end(); } + let kind = 'organic'; if (t.spotId && !isBot(req)) { const g = gates.get(u.searchParams.get('g') || ''); const gi = Number(u.searchParams.get('i')); const isGate = g && g.vk === visitorKey(req) && g.steps[gi] && g.steps[gi].ref === ref; - store.addClick(t.spotId, visitorKey(req), isGate ? 'gate' : 'organic'); + kind = isGate ? 'gate' : 'organic'; + store.addClick(t.spotId, visitorKey(req), kind); } - const loc = t.link.startsWith('/') ? t.link : t.link; + // tracking macros in a member's link (2026-11-13, LinkSpin's "Downline Banners" source): {clickid} a fresh id per click, + // {spot} the spot number, {type} gate or organic + const loc = !t.spotId || t.link.indexOf('{') < 0 ? t.link : t.link + .replace(/\{clickid\}/g, crypto.randomBytes(8).toString('hex')).replace(/\{spot\}/g, String(t.spotId)).replace(/\{type\}/g, kind); res.writeHead(302, { Location: loc, 'Cache-Control': 'no-store', 'Referrer-Policy': 'origin' }); return res.end(); } }