Publisher program (/publishers + zone tiers), chatbot rewritten for LinkSpin, $25 qualification copy fixes
Publisher program (Marty's zone-owner offer for outside site owners):
- /publishers public page: what a zone is, the nine sizes, the waterfall (member ads, network ads, house),
what pays (viewable only, bots never, warm-up 100 views at 40%, cap), what credits buy, install in four steps
with the origin lock explained, Standard/Verified tiers, FAQ, and a live "Network right now" strip
- GET /api/public/publishers: zones installed/live, viewable impressions and credits paid in the last 7 days,
live rates, sizes, warm-up; computed in zones.js and cached a minute
- zones.js: per-zone tier (default standard); verified zones earn network views at nasViewsPerCreditVerified
(default 8) instead of nasViewsPerCredit (10); member-campaign views stay at viewsPerCredit (5) on both tiers;
rateFor/tierOf exported; a pay log (zones.json "pay") so credits can be reported by day; publisherTotals(days)
returns {zones, live, views, viewable, credits, byDay, byZone} with Central day keys for the Reports screen
- admin: Tier select per zone in the Zones pane, saved via POST /api/admin/zones/:id (tier) or the alias
/api/admin/zones/:id/tier; the admin list carries the 7-day publisher totals
- Zones screen: first-run "Add your site" card (site, size, copy the tag, check it is live) for new accounts and
for /zones?start=1 from the publisher page; Verified tag on zone rows; rate note mentions the verified rate
- /partners (downline-builder kit) keeps its URL, gets the real LinkSpin ladder ($10 door to $500 Network, $25
qualifies), the 10% + 10% admin split, and a cross-link to the publisher program
Chatbot: every canned answer and the AI knowledge block now describe LinkSpin (spin links, pages, zones and the
publisher tiers, audiences, promo tools with the five hook angles, blog; the six packages, the 50/20/10/10+10 split,
$25 qualification, pass-ups, the contract; email codes, Control Room screens, sponsor carry-over from the network
registry, free activation). InstantAdPay-only mechanics removed (dormant-lead rescue, Five Dollar Friday, Wired
Wednesday, games, mint passes, surf earn tab); the holding tank stays because /tools > My line still runs it here.
Copy: "Level 2 opens after two of your people buy a $25 or larger package" on the home page, contract, launch,
earning, my, plays pages and promo.js (the $20 figures that remain are the $100 example split amounts).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -479,14 +479,20 @@
|
||||
if (d.error) throw new Error(d.error);
|
||||
const n = v => Number(v || 0).toLocaleString();
|
||||
$('znSub').textContent = n(d.totals.zones) + ' zones · ' + n(d.totals.views30) + ' views in 30 days · ' + n(d.totals.nas30) + ' network · ' + n(d.totals.credits) + ' credits paid';
|
||||
$('znRules').textContent = 'Paid ads (LinkSpin campaigns, then Network Ad Space) serve only when the tag runs on the declared site; anywhere else shows the house banner and earns nothing. A zone earns after its first ' + d.warmup + ' on-site views with at least ' + Math.round(d.holdRatio * 100) + '% viewable, and goes on hold below that. Rates: 1 credit per ' + d.rates.viewsPerCredit + ' LinkSpin views, 1 per ' + d.rates.nasViewsPerCredit + ' network views, ' + d.rates.capPerVisitorDay + ' credited views per visitor per zone per day. Pause a zone to serve house only (brand safety).';
|
||||
const pt = d.publishers || {};
|
||||
$('znRules').textContent = 'Paid ads (LinkSpin campaigns, then Network Ad Space) serve only when the tag runs on the declared site; anywhere else shows the house banner and earns nothing. A zone earns after its first ' + d.warmup + ' on-site views with at least ' + Math.round(d.holdRatio * 100) + '% viewable, and goes on hold below that. Rates: 1 credit per ' + d.rates.viewsPerCredit + ' LinkSpin views, 1 per ' + d.rates.nasViewsPerCredit + ' network views (1 per ' + d.rates.nasViewsPerCreditVerified + ' on a Verified zone), ' + d.rates.capPerVisitorDay + ' credited views per visitor per zone per day. Pause a zone to serve house only (brand safety). Tier: every zone starts Standard; set Verified after reviewing the site (real content, real visitors, tag in view).' + (pt.days ? ' Publisher program, last ' + pt.days + ' days: ' + n(pt.live) + ' live, ' + n(pt.viewable) + ' viewable, ' + n(pt.credits) + ' credits paid.' : '');
|
||||
const ago = t => t ? new Date(t).toLocaleString() : '';
|
||||
$('znTable').innerHTML = '<tr><th>Zone</th><th>Owner</th><th>Site</th><th>Size</th><th>Views</th><th>Viewable</th><th>Mix<br><span class="muted">LinkSpin / network / house / off-site</span></th><th>Clicks</th><th>Credits</th><th>Status</th><th>Last view</th><th></th></tr>'
|
||||
+ (d.zones.length ? d.zones.map(z => '<tr><td><b>' + esc(z.name) + '</b><br><span class="muted small">' + z.id + '</span></td><td>' + esc(z.owner) + '</td><td><a href="https://' + esc(z.site) + '" target="_blank" rel="noopener">' + esc(z.site) + '</a></td><td>' + z.size + '</td><td>' + n(z.views30) + '</td><td>' + (z.viewablePct == null ? '<span class="muted">-</span>' : z.viewablePct + '% ' + (z.grade || '')) + '</td><td>' + n(z.campaign30) + ' / ' + n(z.nas30) + ' / ' + n(z.house30) + ' / ' + n(z.offsite30) + '</td><td>' + n(z.clicks30) + '</td><td>' + n(z.credits) + '</td><td>' + esc(z.statusLabel) + (z.note ? '<br><span class="muted small">' + esc(z.note) + '</span>' : '') + '</td><td>' + ago(z.lastSeen) + '</td><td class="act"><button type="button" class="btn small ghost" data-znpause="' + z.id + '" data-on="' + (z.paused ? 0 : 1) + '">' + (z.paused ? 'Resume' : 'Pause') + '</button></td></tr>').join('') : '<tr><td colspan="12" class="muted">No zones yet.</td></tr>');
|
||||
const tierSel = z => '<select class="small" data-zntier="' + z.id + '" aria-label="Tier">' + (d.tiers || ['standard', 'verified']).map(t => '<option value="' + t + '"' + ((z.tier || 'standard') === t ? ' selected' : '') + '>' + t.charAt(0).toUpperCase() + t.slice(1) + '</option>').join('') + '</select>';
|
||||
$('znTable').innerHTML = '<tr><th>Zone</th><th>Owner</th><th>Site</th><th>Size</th><th>Tier</th><th>Views</th><th>Viewable</th><th>Mix<br><span class="muted">LinkSpin / network / house / off-site</span></th><th>Clicks</th><th>Credits</th><th>Status</th><th>Last view</th><th></th></tr>'
|
||||
+ (d.zones.length ? d.zones.map(z => '<tr><td><b>' + esc(z.name) + '</b><br><span class="muted small">' + z.id + '</span></td><td>' + esc(z.owner) + '</td><td><a href="https://' + esc(z.site) + '" target="_blank" rel="noopener">' + esc(z.site) + '</a></td><td>' + z.size + '</td><td>' + tierSel(z) + '</td><td>' + n(z.views30) + '</td><td>' + (z.viewablePct == null ? '<span class="muted">-</span>' : z.viewablePct + '% ' + (z.grade || '')) + '</td><td>' + n(z.campaign30) + ' / ' + n(z.nas30) + ' / ' + n(z.house30) + ' / ' + n(z.offsite30) + '</td><td>' + n(z.clicks30) + '</td><td>' + n(z.credits) + '</td><td>' + esc(z.statusLabel) + (z.note ? '<br><span class="muted small">' + esc(z.note) + '</span>' : '') + '</td><td>' + ago(z.lastSeen) + '</td><td class="act"><button type="button" class="btn small ghost" data-znpause="' + z.id + '" data-on="' + (z.paused ? 0 : 1) + '">' + (z.paused ? 'Resume' : 'Pause') + '</button></td></tr>').join('') : '<tr><td colspan="13" class="muted">No zones yet.</td></tr>');
|
||||
document.querySelectorAll('[data-znpause]').forEach(b => b.addEventListener('click', async () => {
|
||||
const pausing = b.dataset.on === '1';
|
||||
try { await api('/api/admin/zones/' + b.dataset.znpause, pausing ? { paused: true, note: 'Paused ' + new Date().toLocaleDateString() } : { paused: false, note: '' }, 'POST'); loadZones(); } catch (e) { IAP.status(e.message, 'bad'); }
|
||||
}));
|
||||
// publisher tier (2026-10-10): Verified zones earn network views at the better rate; saved through the zone update route
|
||||
document.querySelectorAll('[data-zntier]').forEach(s => s.addEventListener('change', async () => {
|
||||
try { await api('/api/admin/zones/' + s.dataset.zntier + '/tier', { tier: s.value }, 'POST'); IAP.status('Tier saved: ' + s.value, 'ok'); loadZones(); } catch (e) { IAP.status(e.message, 'bad'); loadZones(); }
|
||||
}));
|
||||
}
|
||||
// ── traffic: referring domains / sources, landing pages, angles, by day ──
|
||||
let trfDays = 30;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
const promo = String(q.get('promo') || '').toUpperCase().replace(/[^A-Z0-9_-]/g, '').slice(0, 24);
|
||||
const ref = String(q.get('ref') || '').toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 20); // a member's own partner kit (Nexus): the deal lands under them
|
||||
const hello = document.getElementById('pkHello');
|
||||
if (hello && name) { hello.textContent = name + ', this page is for you. Your spot directly under the company at the top is reserved; activate with the $20 package to claim it.'; hello.style.display = 'block'; }
|
||||
if (hello && name) { hello.textContent = name + ', this page is for you. Your spot directly under the company at the top is reserved; activate with the $25 Starter package to claim it.'; hello.style.display = 'block'; }
|
||||
const cta = document.getElementById('pkCta');
|
||||
if (cta) {
|
||||
const p = new URLSearchParams(); if (name) p.set('name', name); if (promo) p.set('promo', promo);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// links carry ?v=<angle> and open the matching hook on the join page (join.js knows: instant, adspend, free, ledger, two).
|
||||
// Copy rules: LinkSpin facts only (rewritten 2026-10-08, the earlier text was InstantAdPay's ladder with the name swapped):
|
||||
// packages $10 (door, does not qualify) · $25 · $50 · $100 · $250 · $500, one credit = one cent of delivery, no bonus credits;
|
||||
// a $20+ package makes a qualifying buyer, 2 open level 2, 5 open level 3; split 50 / 20 / 10 + 20 to the platform;
|
||||
// a $25+ package makes a qualifying buyer (the $10 door does not), 2 open level 2, 5 open level 3; split 50 / 20 / 10 + 10 + 10 to the two admin wallets;
|
||||
// seven ad formats: banner, text, login, solo, video, featured, verified visits. No income promises, never a POL figure,
|
||||
// no em dashes.
|
||||
window.IAPPromo = (function () {
|
||||
@@ -53,7 +53,7 @@ window.IAPPromo = (function () {
|
||||
{ q: 'Do I need my own website?', truth: 'No. The rotator and the pages live on LinkSpin\'s link domains, so a member with no site can promote any offer with a spin link and a bridge page. A zone (the ad slot that pays credits) is the one thing that needs a site of your own to paste the script on.', say: 'No site needed. Your spin link and your bridge pages live on LinkSpin\'s domains. If you do have a site, you can also drop in an ad slot that pays you credits, but that part is optional. {{LINK:stack}}' },
|
||||
{ q: 'Why would anyone buy ads here?', truth: 'The members are marketers who already buy traffic. Viewers earn credits only after a server-timed dwell, so impressions are real people. Solo ads reach member inboxes with a guaranteed delivery count, verified visits are one unique member per visit, and banner and text ads also run in member zones on real websites.', say: 'Because the people on it are marketers, and they get paid to actually look. Every view is dwell-timed on the server, solo ads land in real inboxes with a guaranteed count, and verified visits are one real person each. You can watch your own campaign serve: {{LINK:zones}}' },
|
||||
{ q: 'I do not know anyone to refer.', truth: 'Referrals are optional. Members can use the rotator, the pages and a zone, view ads, earn credits and advertise with no line at all. When they do refer, every direct buyer pays them 50 percent from the very first qualifying package.', say: 'You do not have to refer anyone. Join free, use the tools, earn credits by viewing, run ads. If one person ever joins through you and buys a $25 package, half of it hits your wallet in that transaction. That is the whole referral side, and it is optional. {{LINK:stack}}' },
|
||||
{ q: 'How much can I make?', truth: 'No income is guaranteed or implied. Sponsor commissions are 50 / 20 / 10 across three levels on packages that actually sell; level 2 needs 2 qualifying buyers ($20 or more) and level 3 needs 5. Results depend on the member\'s effort, and crypto carries risk of loss. Never quote a figure.', say: 'Nobody can tell you that, and I would not trust anyone who did. What I can tell you is exactly how it is split: 50 percent to the direct sponsor, 20 and 10 to the next two levels, paid the moment a package sells, all public. What that adds up to depends entirely on what you build. {{LINK}}' }
|
||||
{ q: 'How much can I make?', truth: 'No income is guaranteed or implied. Sponsor commissions are 50 / 20 / 10 across three levels on packages that actually sell; level 2 needs 2 qualifying buyers ($25 or more) and level 3 needs 5. Results depend on the member\'s effort, and crypto carries risk of loss. Never quote a figure.', say: 'Nobody can tell you that, and I would not trust anyone who did. What I can tell you is exactly how it is split: 50 percent to the direct sponsor, 20 and 10 to the next two levels, paid the moment a package sells, all public. What that adds up to depends entirely on what you build. {{LINK}}' }
|
||||
];
|
||||
|
||||
function fillLink(text, link) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// Publisher program page (2026-10-10): fills the "Network right now" strip and every rate number from
|
||||
// /api/public/publishers (server-side totals, cached a minute), and points Start at the Zones screen when the visitor
|
||||
// is already signed in (otherwise the join page, zones angle). Display only; nothing here changes an account.
|
||||
(function () {
|
||||
const $ = id => document.getElementById(id);
|
||||
const fmt = n => Number(n || 0).toLocaleString();
|
||||
const ago = t => { if (!t) return ''; const d = Date.now() - t; if (d < 90e3) return 'updated just now'; if (d < 3600e3) return 'updated ' + Math.round(d / 60e3) + ' min ago'; return 'updated ' + Math.round(d / 3600e3) + ' h ago'; };
|
||||
async function strip() {
|
||||
let d; try { d = await (await fetch('/api/public/publishers')).json(); } catch (e) { $('stUpdated').textContent = 'live numbers unavailable right now'; $('stDot').classList.add('off'); return; }
|
||||
$('stLive').textContent = fmt(d.live); $('stViews').textContent = fmt(d.viewable7); $('stCredits').textContent = fmt(d.credits7);
|
||||
$('stUpdated').textContent = (d.zones ? fmt(d.zones) + ' zone' + (d.zones === 1 ? '' : 's') + ' installed · ' : '') + ago(d.updated);
|
||||
if (!d.live) $('stDot').classList.add('off');
|
||||
const r = Object.assign({}, d.rates || {}); r.warmup = d.warmup; r.holdPct = Math.round((d.holdRatio || 0.4) * 100);
|
||||
document.querySelectorAll('[data-rate]').forEach(el => { const v = r[el.dataset.rate]; if (v != null && v !== '') el.textContent = fmt(v); });
|
||||
}
|
||||
// signed in already? then Start opens the Zones screen with the first-run card; the join page otherwise
|
||||
async function start() {
|
||||
try { localStorage.setItem('ls.publisher', '1'); } catch (e) {}
|
||||
let signedIn = false; try { signedIn = (await fetch('/api/my/zones', { cache: 'no-store' })).status === 200; } catch (e) {}
|
||||
if (!signedIn) return;
|
||||
document.querySelectorAll('[data-start]').forEach(a => { a.href = '/zones?start=1'; if (/^Start/.test(a.textContent)) a.textContent = 'Open Zones: add your site'; });
|
||||
document.querySelectorAll('[data-join]').forEach(a => { a.href = '/links'; a.textContent = 'Control Room'; });
|
||||
}
|
||||
strip(); start();
|
||||
setInterval(strip, 60000);
|
||||
})();
|
||||
@@ -7,13 +7,14 @@
|
||||
const tag = z => '<script async src="https://' + HOST + '/z.js" data-zone="' + z.id + '"></script>';
|
||||
async function load() {
|
||||
let r; try { r = await CR.get('/api/my/zones'); } catch (e) { CR.sub('could not load'); return; }
|
||||
Z = r.zones || []; HOST = r.host || HOST; SIZES = r.sizes || []; RATE = r.rates || {};
|
||||
Z = r.zones || []; HOST = r.host || HOST; SIZES = r.sizes || []; RATE = r.rates || {}; RATE.warmup = r.warmup || 100;
|
||||
const t = Z.reduce((a, z) => { a.v += z.views30; a.ok += z.viewable30; a.k += z.clicks30; a.c += z.credits; return a; }, { v: 0, ok: 0, k: 0, c: 0 });
|
||||
CR.sub(Z.length + ' zone' + (Z.length === 1 ? '' : 's') + ' · ' + fmt(t.v) + ' views in 30 days');
|
||||
$('tiles').innerHTML = [['Views served, 30 d', fmt(t.v)], ['Viewable', t.v ? Math.round(t.ok / t.v * 100) + '%' : '0%'], ['Clicks out', fmt(t.k)], ['Credits earned', fmt(t.c)]].map(([k, v], i) => '<div class="tile' + (i === 3 ? ' hi' : '') + '"><span class="k">' + k + '</span><span class="v">' + v + '</span></div>').join('');
|
||||
$('rateNote').textContent = 'You earn 1 credit per ' + (RATE.viewsPerCredit || 5) + ' viewable views of a LinkSpin campaign and 1 per ' + (RATE.nasViewsPerCredit || 10) + ' viewable views of a network ad, capped at ' + (RATE.capPerVisitorDay || 50) + ' credited views per visitor per zone per day. House banners are not paid. Bots never count.';
|
||||
$('rateNote').textContent = 'You earn 1 credit per ' + (RATE.viewsPerCredit || 5) + ' viewable views of a LinkSpin campaign and 1 per ' + (RATE.nasViewsPerCredit || 10) + ' viewable views of a network ad (1 per ' + (RATE.nasViewsPerCreditVerified || 8) + ' on a Verified zone), capped at ' + (RATE.capPerVisitorDay || 50) + ' credited views per visitor per zone per day. House banners are not paid. Bots never count. Every zone starts Standard; a reviewed site can be marked Verified by the admin.';
|
||||
firstRun();
|
||||
const q = g => '<span class="q ' + (g === 'A' ? 'ok' : g === 'B' ? 'warn' : g === 'C' ? 'bad' : 'muted') + '">' + [1, 2, 3, 4, 5].map(i => '<i class="' + (g === 'A' ? (i <= 5 ? 'on' : '') : g === 'B' ? (i <= 3 ? 'on' : '') : g === 'C' ? (i <= 1 ? 'on' : '') : '') + '"></i>').join('') + '</span>' + (g || '');
|
||||
$('rows').innerHTML = Z.length ? Z.map(z => '<div class="rw' + (z.id === SEL ? ' on' : '') + '"><div><b>' + esc(z.name) + '</b>' + (z.site ? ' <span class="muted">· ' + esc(z.site) + '</span>' : '') + '<br><span class="mono muted" style="font-size:11px">' + z.id + ' · ' + (z.lastSeen ? 'last view ' + ago(z.lastSeen) : 'no views yet') + (z.views30 ? ' · mix: ' + fmt(z.campaign30 || 0) + ' LinkSpin / ' + fmt(z.nas30 || 0) + ' network / ' + fmt(z.house30 || 0) + ' house' : '') + '</span></div><span class="mono">' + z.size + '</span><span class="r num">' + fmt(z.views30) + '</span><span class="r num">' + (z.viewablePct == null ? '<span class="muted">·</span>' : z.viewablePct + '%') + '</span><span class="r num">' + fmt(z.credits) + '</span><span class="mono" style="font-size:11px">' + (z.grade ? q(z.grade) : '<span class="muted">no data</span>') + ' <span class="tag ' + (z.status === 'earning' ? 'ok' : z.status === 'warming' ? '' : 'warn') + '">' + esc(z.statusLabel || '') + '</span>' + '</span><span style="display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap"><button class="btn sm" type="button" data-tag="' + z.id + '">Tag</button><button class="btn sm" type="button" data-tog="' + z.id + '">' + (z.active ? 'Off' : 'On') + '</button><button class="btn sm danger" type="button" data-del="' + z.id + '" aria-label="Remove">×</button></span></div>').join('')
|
||||
$('rows').innerHTML = Z.length ? Z.map(z => '<div class="rw' + (z.id === SEL ? ' on' : '') + '"><div><b>' + esc(z.name) + '</b>' + (z.site ? ' <span class="muted">· ' + esc(z.site) + '</span>' : '') + (z.tier === 'verified' ? ' <span class="tag ok">Verified</span>' : '') + '<br><span class="mono muted" style="font-size:11px">' + z.id + ' · ' + (z.lastSeen ? 'last view ' + ago(z.lastSeen) : 'no views yet') + (z.views30 ? ' · mix: ' + fmt(z.campaign30 || 0) + ' LinkSpin / ' + fmt(z.nas30 || 0) + ' network / ' + fmt(z.house30 || 0) + ' house' : '') + '</span></div><span class="mono">' + z.size + '</span><span class="r num">' + fmt(z.views30) + '</span><span class="r num">' + (z.viewablePct == null ? '<span class="muted">·</span>' : z.viewablePct + '%') + '</span><span class="r num">' + fmt(z.credits) + '</span><span class="mono" style="font-size:11px">' + (z.grade ? q(z.grade) : '<span class="muted">no data</span>') + ' <span class="tag ' + (z.status === 'earning' ? 'ok' : z.status === 'warming' ? '' : 'warn') + '">' + esc(z.statusLabel || '') + '</span>' + '</span><span style="display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap"><button class="btn sm" type="button" data-tag="' + z.id + '">Tag</button><button class="btn sm" type="button" data-tog="' + z.id + '">' + (z.active ? 'Off' : 'On') + '</button><button class="btn sm danger" type="button" data-del="' + z.id + '" aria-label="Remove">×</button></span></div>').join('')
|
||||
: '<div class="rw"><span class="muted">No zones yet. Add one, paste the tag on your site, and the banner is live.</span></div>';
|
||||
$('foot').textContent = 'viewable = at least half the banner on screen for one second, reported by the tag · quality: A 60%+ viewable, B 40%+, C below · paid ads serve only on the declared site; a zone earns after its first 100 on-site views with 40%+ viewable and goes on hold below that';
|
||||
$('rows').querySelectorAll('[data-tag]').forEach(b => b.addEventListener('click', () => showTag(b.dataset.tag)));
|
||||
@@ -21,11 +22,30 @@
|
||||
$('rows').querySelectorAll('[data-del]').forEach(b => b.addEventListener('click', async () => { if (!await dialog({ title: 'Remove this zone?', text: 'The tag on your site stops showing ads. Credits already earned stay.', ok: 'Remove', danger: true })) return; try { await api('/api/my/zones/' + b.dataset.del, { remove: true }); SEL = null; $('tagPanel').hidden = true; load(); } catch (e) { toast(e.message, true); } }));
|
||||
if (SEL && Z.find(z => z.id === SEL)) showTag(SEL);
|
||||
}
|
||||
function showTag(id) { const z = Z.find(x => x.id === id); if (!z) return; SEL = id; $('tagPanel').hidden = false; $('tagTitle').textContent = 'Embed tag · ' + z.name; $('tagCode').textContent = tag(z); $('tagNote').textContent = 'Paste it where the banner should appear (' + z.size + '). It sizes itself and never loads more than one ad. Tip: do not wrap it in an element whose class or id contains "ad", "banner" or "sponsor" (ad blockers hide those), and if you test with an ad blocker on, pause it for your own site first.'; $('tagCopy').onclick = () => CR.copy(tag(z)); $('tagCheck').onclick = async () => { await load(); const zz = Z.find(x => x.id === id); toast(zz && zz.lastSeen && Date.now() - zz.lastSeen < 3600e3 ? 'Live: last view ' + ago(zz.lastSeen) : 'No view in the last hour. Is the tag on a page people open?', !(zz && zz.lastSeen && Date.now() - zz.lastSeen < 3600e3)); }; }
|
||||
$('newBtn').addEventListener('click', async () => {
|
||||
function showTag(id) { const z = Z.find(x => x.id === id); if (!z) return; SEL = id; $('tagPanel').hidden = false; $('tagTitle').textContent = 'Embed tag · ' + z.name; $('tagCode').textContent = tag(z); $('tagNote').textContent = 'Paste it where the banner should appear (' + z.size + '). It sizes itself and never loads more than one ad. Tip: do not wrap it in an element whose class or id contains "ad", "banner" or "sponsor" (ad blockers hide those), and if you test with an ad blocker on, pause it for your own site first.'; $('tagCopy').onclick = () => { CR.copy(tag(z)); COPIED = true; LS.set('ls.zoneTagCopied', '1'); firstRun(); }; $('tagCheck').onclick = async () => { await load(); const zz = Z.find(x => x.id === id); toast(zz && zz.lastSeen && Date.now() - zz.lastSeen < 3600e3 ? 'Live: last view ' + ago(zz.lastSeen) : 'No view in the last hour. Is the tag on a page people open?', !(zz && zz.lastSeen && Date.now() - zz.lastSeen < 3600e3)); }; }
|
||||
async function addZone() {
|
||||
const v = await dialog({ title: 'Add a zone', text: 'One zone per spot on a page. Paid ads only serve on the site you name here; anywhere else the tag shows the house banner.', fields: [{ k: 'name', label: 'Name', placeholder: 'My blog · sidebar', max: 60 }, { k: 'site', label: 'Site it lives on (required)', placeholder: 'myblog.com', max: 80 }, { k: 'size', label: 'Size: ' + (SIZES.join(', ') || '728x90, 468x60, 300x250, 160x600, 320x50'), value: '728x90', mono: true }], ok: 'Create' });
|
||||
if (!v) return; try { const r = await api('/api/my/zones', v); SEL = r.zone.id; toast('Zone created. Copy the tag.'); load(); } catch (e) { toast(e.message, true); }
|
||||
});
|
||||
}
|
||||
$('newBtn').addEventListener('click', addZone);
|
||||
// ---- first-run card (publisher onboarding, 2026-10-10): site, size, copy the tag, check it is live. Shows while the
|
||||
// account has no zone with a view, or when /zones?start=1 (the /publishers Start button) asks for it; Hide remembers.
|
||||
const START = /[?&]start=1\b/.test(location.search); const LS = { get: k => { try { return localStorage.getItem(k); } catch (e) { return null; } }, set: (k, v) => { try { localStorage.setItem(k, v); } catch (e) {} } };
|
||||
let COPIED = LS.get('ls.zoneTagCopied') === '1';
|
||||
function firstRun() {
|
||||
const fr = $('firstRun'); if (!fr) return;
|
||||
const live = Z.some(z => z.lastSeen); const hidden = LS.get('ls.zonesFirstRunHidden') === '1';
|
||||
if ((hidden || live) && !START) { fr.hidden = true; return; }
|
||||
fr.hidden = false;
|
||||
const step = !Z.length ? 1 : (!COPIED && !live) ? 3 : !live ? 4 : 5; // 1-2 site+size, 3 copy, 4 check, 5 done
|
||||
const steps = [['Your site', 'The domain the tag will live on, exactly as the address bar shows it. Paid ads serve only there.'], ['Size', 'The banner size of the spot. 728x90 and 468x60 also get network ads.'], ['Copy the tag', 'Paste it where the banner should appear: a widget, a template, an HTML block.'], ['Check it is live', 'Open your page once, then press the button. The warm-up counter starts with that first view.']];
|
||||
$('frSteps').innerHTML = steps.map(([t, d], i) => { const n = i + 1; const done = n < step || (n <= 2 && step > 2) || step === 5; const now = !done && (n === step || (step === 1 && n === 2)); return '<li class="' + (done ? 'done' : now ? 'now' : '') + '"><b><i>' + (done ? '✓' : n) + '</i>' + t + '</b><span class="muted">' + d + '</span></li>'; }).join('');
|
||||
$('frTitle').textContent = step === 5 ? 'Your site is live' : 'Add your site';
|
||||
$('frIntro').textContent = step === 5 ? 'The tag is serving. The zone earns after its first ' + (RATE.warmup || 100) + ' on-site views with 40% or more viewable; the status column tells you where it stands. Add another spot any time.' : step >= 3 ? 'Zone created. Copy the tag, paste it on ' + esc(Z[0].site) + ', then check it is live.' : '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.';
|
||||
const go = $('frGo'); go.textContent = step === 1 ? 'Add your site' : step === 3 ? 'Show the tag' : step === 4 ? 'Check it is live' : 'Add another zone';
|
||||
go.onclick = () => { if (step === 1 || step === 5) return addZone(); showTag(Z[0].id); if (step === 4) $('tagCheck').click(); };
|
||||
$('frHide').onclick = () => { LS.set('ls.zonesFirstRunHidden', '1'); fr.hidden = true; };
|
||||
}
|
||||
// ---- audiences (first-party retargeting)
|
||||
const ptag = a => '<script async src="https://' + HOST + '/p.js" data-aud="' + a.id + '"></script>';
|
||||
async function loadAudiences() {
|
||||
|
||||
Reference in New Issue
Block a user