Files
linkspin/public/zones.html
T
martbost 211eb5a0e8 Traffic sources: network macros, campaign URLs, per-source postbacks, Reports dimension
A Source is a first-class record of a network a member buys traffic on (PropellerAds,
Zeropark, Adsterra, ExoClick and 25 more from the shipped catalog, or defined by hand).
It remembers the network's macro tokens and conversion postback, attaches to spin links,
builds the exact campaign URL to paste into the network, fires that network's own
postback only for clicks that came through it, and shows up in Reports by source and
by the zone / placement / site the macro carried.

- data/traffic-sources.json: catalog of 29 networks (BeMob template harvest), un-ignored
  via data/* + !data/traffic-sources.json; loader tolerates missing fields, null costModel,
  {{slot}} labels with spaces and parentheses, optional slots, unknown single-brace macros
- sources.js: DATA_DIR/sources.json model, 30 per account, 20 params, key allow-list,
  postbacks.validateUrl on the filled postback; list/create/update/get/urlFor/test
- rotator.js: update() takes sourceId (owner-checked), pub() exposes it, hits and conversions
  are stamped with the source at click time (sr), wider query allow-list (cost, creative,
  site, banner, keyword, geo, os, browser, device, carrier, format, external_id, visitor_id),
  summary() adds sources[] and placements[], sourceCounts(), detachSource()
- postbacks.js: fire() delivers the matching source's postback after the manual ones through
  the same deliver() (guards, retry, rate cap, auto-disable); log rows carry source; convertFor,
  inbound and the page lead path pass sourceId; fill/deliver/logForSource exported
- routes (GET and POST): /api/sources/catalog, /api/my/sources, /api/my/sources/<id>,
  /api/my/sources/<id>/url; /sources screen
- /sources Control Room screen (list + Campaign URL / Postback / Settings tabs, two-step
  New source dialog); Links share kit gets a source select and a "Campaign URL for <network>"
  first row; Reports gets Traffic sources and Placements; rail entry; chatbot canned answer,
  FACTS line and KNOWLEDGE_DATE 2026-10-12
- cr.css: phone rail icons only at 34px so ten entries fit; cache tags bumped to 20261012a

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 11:16:24 -05:00

48 lines
5.0 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<title>Zones · LinkSpin</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
<link rel="stylesheet" href="/assets/cr.css?v=20261012a">
<style>
.body{padding:16px 24px;display:grid;gap:16px}
.two{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:16px}
.zl .hd,.zl .rw{grid-template-columns:minmax(220px,2fr) 72px 64px 76px 72px minmax(150px,1fr) 124px}
@media (max-width:1400px){.two{grid-template-columns:1fr}}
.zl .rw>*{min-width:0}.zl .rw .pill,.zl .rw .tag{white-space:normal;line-height:1.3}.zl .rw .acts{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap}
.q{display:inline-flex;gap:2px;vertical-align:middle;margin-right:6px} .q i{display:block;width:4px;height:10px;background:var(--line)} .q i.on{background:currentColor}
@media (max-width:900px){.two{grid-template-columns:1fr}.zl .hd{display:none}.zl .rw{grid-template-columns:1fr 1fr}.body{padding:12px 16px}}
.fr{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,2fr);gap:18px;align-items:start}
.fr-steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.fr-steps li{border:1px solid var(--line);border-radius:8px;padding:12px;display:grid;gap:4px;font-size:13px}
.fr-steps li b{display:flex;align-items:center;gap:8px}
.fr-steps li b i{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;border:1.5px solid var(--line-strong);font:700 11px var(--mono);font-style:normal;flex:none}
.fr-steps li.now{border-color:var(--sig);background:var(--sig-soft)} .fr-steps li.now b i{background:var(--sig);border-color:var(--sig);color:#fff}
.fr-steps li.done{opacity:.75} .fr-steps li.done b i{background:var(--ok);border-color:var(--ok);color:#fff}
@media (max-width:1100px){.fr{grid-template-columns:1fr}.fr-steps{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){.fr-steps{grid-template-columns:1fr}}
</style>
</head>
<body>
<div id="page">
<div class="body">
<div class="panel" id="firstRun" hidden><div class="fr"><div><h2 id="frTitle">Add your site</h2><div class="ink2" id="frIntro">Four steps and your site is carrying the network. Paid ads serve only on the site you name, and every viewable impression pays you ad credits.</div><div style="display:flex;gap:8px;flex-wrap:wrap;margin-top:12px"><button class="btn pri sm" type="button" id="frGo">Add your site</button><button class="btn sm ghost" type="button" id="frHide">Hide this</button><a class="btn sm ghost" href="/publishers" target="_blank" rel="noopener">How the program works</a></div></div><ol class="fr-steps" id="frSteps"></ol></div></div>
<div class="tiles" id="tiles"></div>
<div class="two">
<div class="tbl zl"><div class="hd"><span>Zone</span><span>Size</span><span class="r">Views</span><span class="r">Viewable</span><span class="r">Credits</span><span>Quality</span><span></span></div><div id="rows"></div><div class="ft" id="foot"></div></div>
<div style="display:grid;gap:16px;align-content:start">
<div class="panel" id="tagPanel" hidden><h2 id="tagTitle">Embed tag</h2><div class="code" id="tagCode" style="display:block;font-size:11px;line-height:1.6;word-break:break-all"></div><div style="display:flex;gap:8px;flex-wrap:wrap"><button class="btn sm" type="button" id="tagCopy">Copy tag</button><button class="btn sm" type="button" id="tagCheck">Check it is live</button></div><div class="muted" id="tagNote">Paste it where the banner should appear. It sizes itself.</div></div>
<div class="panel" id="audPanel"><h2>Audiences</h2><div class="ink2">Your own retargeting. Every visitor to your LinkSpin pages and your zones lands in <b>My visitors</b> for 30 days, no setup. For any other site you control, paste an audience pixel. Then, on any banner or text campaign, choose "show only to" or "never show to" an audience.</div><div id="audList" class="ink2">loading</div><div style="display:flex;gap:8px;flex-wrap:wrap"><button class="btn sm" type="button" id="audNew">+ New audience</button></div><div class="muted" style="font-size:11.5px">Counts are visitors seen in the last 30 days. The match uses a LinkSpin cookie, with a 24-hour fallback where a browser blocks cross-site cookies, so Safari and Firefox visitors on other sites match less often. Nothing personal is stored.</div></div>
<div class="panel"><h2>What runs here</h2><div class="ink2">Three tiers, in order: a LinkSpin member campaign (the same pool the ad viewer serves), then a Network Ad Space ad for 728x90 and 468x60 zones, then a LinkSpin house banner. Your site carries the whole network, not just LinkSpin.</div><div class="muted" id="rateNote"></div></div>
</div>
</div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261012a"></script>
<script src="/assets/zones-screen.js?v=20261010a"></script>
</body>
</html>