Traffic guide (/traffic-guide): which ad formats convert for which offer, all 30 catalog networks with the formats they sell plus adult-heavy and strict-policy flags, ground rules; Sources screen gets a Traffic guide button, format tags in the New source picker (searchable by format) and a 'sells / best for' line on each source; chatbot answer + facts (Marty 2026-10-28: members asked what traffic suits which ads)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-28 07:30:28 -05:00
parent 9ebbef2d21
commit 1e8addc801
7 changed files with 294 additions and 7 deletions
+11 -4
View File
@@ -5,7 +5,11 @@
(function () {
const $ = id => document.getElementById(id); const esc = CR.esc, fmt = CR.fmt, api = CR.api, toast = CR.toast, dialog = CR.dialog;
let S = [], CAT = [], ROT = [], SEL = null, DET = null, FILTER = '', KEYS = [], EVENTS = ['join', 'lead', 'wallet', 'purchase', 'external'], LIMITS = {}, URL_ROT = null, PE = [];
CR.mount({ active: 'sources', title: 'Traffic sources', sub: 'loading', actions: '<button class="btn pri" type="button" id="newBtn">+ New source</button>' });
CR.mount({ active: 'sources', title: 'Traffic sources', sub: 'loading', actions: '<a class="btn sm" href="/traffic-guide" title="Which traffic works for which kind of offer">Traffic guide</a> <button class="btn pri" type="button" id="newBtn">+ New source</button>' });
// traffic guide (2026-10-28): formats each network sells, adult-heavy / strict-policy flags, what it suits best
const TG = window.TRAFFIC_GUIDE || null;
const gTags = key => { const n = TG && TG.NETWORKS[key]; if (!n) return ''; return n.f.map(f => '<span class="tag plain">' + esc(TG.fmtName(f)) + '</span>').join('') + (n.adult === 'adult' ? '<span class="tag warn">adult sites</span>' : n.adult === 'mixed' ? '<span class="tag dim" title="Big adult inventory; target its mainstream sites">adult-heavy</span>' : '') + (n.strict ? '<span class="tag warn" title="Strict ad policy: crypto, income claims and MLM are restricted or need approval">strict policy</span>' : ''); };
const gText = key => { const n = TG && TG.NETWORKS[key]; return n ? n.f.map(f => (TG.FORMATS[f] || {}).name || f).join(' ') : ''; };
const ago = ts => { if (!ts) return 'never'; const s = Math.max(0, Math.round((Date.now() - ts) / 1000)); return s < 60 ? 'just now' : s < 3600 ? Math.round(s / 60) + ' min ago' : s < 86400 ? Math.round(s / 3600) + ' h ago' : Math.round(s / 86400) + ' d ago'; };
const netOf = s => CAT.find(c => c.key === s.template) || null;
const netName = s => { const n = netOf(s); return n ? n.name : (s.template === 'custom' ? 'Custom' : s.template); };
@@ -43,6 +47,9 @@
$('dOn').innerHTML = s.enabled ? '<span class="ok"><span class="dot"></span>ON</span>' : '<span class="warn"><span class="dot"></span>OFF' + (s.fails >= 10 ? ' (postback failed 10 times)' : '') + '</span>';
$('togBtn').textContent = s.enabled ? 'Disable' : 'Enable';
$('tiles').innerHTML = [CR.tile({ k: 'Clicks, 30 d', v: fmt(s.hits30 || 0), hi: true }), CR.tile({ k: 'Unique, 30 d', v: fmt(s.unique30 || 0) }), CR.tile({ k: 'Conversions, 30 d', v: fmt(s.conv30 || 0) }), CR.tile({ k: 'Postbacks sent', v: fmt(s.sent || 0), note: s.lastAt ? 'last ' + ago(s.lastAt) + ' · ' + s.lastStatus : 'none yet' }), CR.tile({ k: 'Links using it', v: fmt(s.links || 0) })].join('');
const gb = TG && TG.NETWORKS[s.template], bf = gb ? TG.bestFor(s.template) : [];
$('dGuide').hidden = !gb;
if (gb) $('dGuide').innerHTML = (gb.f.length ? '<span>Sells</span>' + gTags(s.template) : gTags(s.template)) + (bf.length ? '<span>· Best for: <b>' + esc(bf.join(', ')) + '</b></span>' : (gb.note ? '<span>' + esc(gb.note) + '</span>' : '')) + '<span class="grow"></span><a href="/traffic-guide">Which traffic for which offer &rarr;</a>';
renderUrl(s); renderPb(s, null); renderSettings(s);
if (!quiet) window.scrollTo({ top: 0 });
try { DET = await CR.get('/api/my/sources/' + id); } catch (e) { DET = null; }
@@ -102,14 +109,14 @@
async function newSource() {
if (!CAT.length) { try { CAT = (await CR.get('/api/sources/catalog')).catalog || []; } catch (e) {} }
let chosen = null;
const row = c => '<div class="cat" data-key="' + esc(c.key) + '" role="button" tabindex="0"><div><b>' + esc(c.name) + '</b><span class="site">' + esc(c.site || '') + (c.costModel ? ' · ' + esc(c.costModel) : '') + '</span></div><div class="tags">' + (c.hasClickId ? '' : '<span class="tag warn" title="This network has no click id macro and no postback. The source still tags your campaign URL and shows in Reports.">no click id</span>') + (c.hasPostback ? '<span class="tag ok">postback</span>' : (c.hasClickId ? '<span class="tag dim">no postback</span>' : '')) + (c.verified ? '' : '<span class="tag dim" title="Macros copied from public docs, not yet checked against a live account">unverified</span>') + '</div></div>';
const p1 = dialog({ title: 'New source', text: 'Pick the network you buy traffic on. Its macros and postback come prefilled; you can change anything later under Settings.',
const row = c => '<div class="cat" data-key="' + esc(c.key) + '" role="button" tabindex="0"><div><b>' + esc(c.name) + '</b><span class="site">' + esc(c.site || '') + (c.costModel ? ' · ' + esc(c.costModel) : '') + '</span>' + (gTags(c.key) ? '<div class="fm">' + gTags(c.key) + '</div>' : '') + '</div><div class="tags">' + (c.hasClickId ? '' : '<span class="tag warn" title="This network has no click id macro and no postback. The source still tags your campaign URL and shows in Reports.">no click id</span>') + (c.hasPostback ? '<span class="tag ok">postback</span>' : (c.hasClickId ? '<span class="tag dim">no postback</span>' : '')) + (c.verified ? '' : '<span class="tag dim" title="Macros copied from public docs, not yet checked against a live account">unverified</span>') + '</div></div>';
const p1 = dialog({ title: 'New source', text: 'Pick the network you buy traffic on. Its macros and postback come prefilled; you can change anything later under Settings. Search by name or by format (pop, push, native...). Not sure which fits your offer? See the Traffic guide.',
html: '<input class="field catf" id="catFilter" type="search" placeholder="Search ' + CAT.length + ' networks by name or site" aria-label="Search networks"><div class="catlist" id="catList">' + CAT.map(row).join('') + '</div>', ok: 'Custom (define your own)', no: 'Cancel' });
const host = $('crModalHost');
const wire = () => host.querySelectorAll('.cat').forEach(el => { const go = () => { chosen = el.dataset.key; host.querySelector('#dlgOk').click(); }; el.addEventListener('click', go); el.addEventListener('keydown', e => { if (e.key === 'Enter') { e.preventDefault(); go(); } }); });
wire();
const flt = host.querySelector('#catFilter'); flt.focus();
flt.addEventListener('input', () => { const q = flt.value.trim().toLowerCase(); const list = CAT.filter(c => !q || c.name.toLowerCase().includes(q) || (c.site || '').toLowerCase().includes(q) || c.key.includes(q)); host.querySelector('#catList').innerHTML = list.length ? list.map(row).join('') : '<div class="cat"><span class="muted">No network by that name. Use Custom and paste its macros yourself.</span></div>'; wire(); });
flt.addEventListener('input', () => { const q = flt.value.trim().toLowerCase(); const list = CAT.filter(c => !q || c.name.toLowerCase().includes(q) || (c.site || '').toLowerCase().includes(q) || c.key.includes(q) || gText(c.key).toLowerCase().includes(q)); host.querySelector('#catList').innerHTML = list.length ? list.map(row).join('') : '<div class="cat"><span class="muted">No network by that name. Use Custom and paste its macros yourself.</span></div>'; wire(); });
flt.addEventListener('keydown', e => { if (e.key === 'Enter') { e.preventDefault(); e.stopPropagation(); const first = host.querySelector('.cat[data-key]'); if (first) first.click(); } });
const ok = await p1; if (!ok) return;
const tpl = chosen ? CAT.find(c => c.key === chosen) : null;
+149
View File
@@ -0,0 +1,149 @@
// LinkSpin traffic guide data (2026-10-28, Marty: members ask "what traffic for what kind of offer?").
// Shared by the Traffic guide page (/traffic-guide) and the Sources screen (format tags, "good for" line).
// Network formats are what each network is known to sell; members should still confirm in their own ad panel.
window.TRAFFIC_GUIDE = (function () {
const FORMATS = {
pop: {
name: 'Popunder', short: 'Pop',
what: 'Your page opens in a new window or tab behind (or over) the site the visitor was reading.',
buy: 'Usually CPM or CPV (per thousand views). The cheapest clicks you can buy, and the most of them.',
wins: 'One-step offers that need no trust: free sign-ups, email capture, giveaways, games, app installs.',
fails: 'Anything that needs explaining or trust first: long sales letters, high-ticket offers, a cold opportunity pitch.',
page: 'Fast, mobile, one headline and one big button. If it takes more than a few seconds to load, the visitor is gone.',
},
push: {
name: 'Push notifications', short: 'Push',
what: 'A short notification with an icon and a headline, sent to people who allowed notifications from some site.',
buy: 'CPC (per click). You only pay when someone taps.',
wins: 'Curiosity and news-style hooks: lead capture, giveaways, games, "how I..." stories, free tools.',
fails: 'Sending the click straight to a checkout or a signup that asks for a lot. Push readers want a quick payoff.',
page: 'Use a short pre-lander that continues the headline, then the sign-up. Refresh the headline and icon often; push audiences tire fast.',
},
inpage: {
name: 'In-page push', short: 'In-page',
what: 'An ad that looks like a push notification but shows inside the web page (works on iPhones too).',
buy: 'CPC or CPM.',
wins: 'The same offers as push and pop: free sign-ups, giveaways, games, quick lead forms.',
fails: 'Offers that need a long read before anyone acts.',
page: 'Same as push: a headline that promises one thing, and a page that delivers it right away.',
},
native: {
name: 'Native ads', short: 'Native',
what: 'A thumbnail and headline inside "recommended stories" boxes on news and content sites.',
buy: 'CPC. Clicks cost more than pop or push, but readers are in reading mode.',
wins: 'Story-style pre-sells: courses and info products, software, an opportunity explained through your own story.',
fails: 'Hard sells and hype. Mainstream native networks reject income claims and are strict about crypto.',
page: 'An article or "my story" page that warms the reader up, then sends them to the sign-up. Never a bare sign-up form.',
},
search: {
name: 'Search ads', short: 'Search',
what: 'Text ads next to search results, shown to people typing a keyword you bid on.',
buy: 'CPC on keywords. Can be pricey on popular words, cheap on specific ones.',
wins: 'Things people already look for: advertising tools, buying website traffic, software, how-to courses.',
fails: 'Offers nobody searches for. Google and Microsoft also restrict crypto, income opportunities and MLM.',
page: 'Match the keyword in your headline. A searcher wants the answer to what they typed, not a detour.',
},
social: {
name: 'Social ads', short: 'Social',
what: 'Ads in social feeds and stories, aimed by interests, age and location.',
buy: 'CPM or CPC, set by auction.',
wins: 'Video and story content, free lead magnets, community and webinar invites, software and courses.',
fails: 'Direct crypto or "make money" pitches: Facebook restricts them, and accounts get banned for it.',
page: 'Lead with something free and useful (a guide, a video, a webinar), then follow up by email.',
},
display: {
name: 'Banners', short: 'Banner',
what: 'Image ads in fixed spots on websites (728x90, 300x250 and so on).',
buy: 'CPM or CPC.',
wins: 'Retargeting people who already know you, brand reminders, simple free offers.',
fails: 'Cold, complex offers. Banner click rates are low, so the offer has to be obvious at a glance.',
page: 'Bold, simple creative with one message. Test several sizes; some spots convert far better than others.',
},
redirect: {
name: 'Domain redirect', short: 'Redirect',
what: 'Visitors who typed a parked or expired domain are sent straight to your page (also called zero-click).',
buy: 'CPV (per visit).',
wins: 'Lead capture, giveaways, simple sign-ups in the right niche.',
fails: 'Offers that need a pre-sell. The visitor did not choose your ad.',
page: 'Fast and simple, like pop traffic.',
},
};
// offer types LinkSpin members promote; rating per format: best / good / weak / avoid, with a one-line why
const OFFERS = [
{ key: 'join', name: 'Free sign-up or email capture', ex: 'a free join page, a squeeze page, a lead magnet',
fit: { pop: ['best', 'Cheap volume for a one-field page'], inpage: ['best', 'Works on every phone, fast decision'], push: ['good', 'Use a short pre-lander first'], native: ['good', 'Pre-sell with a story, then the form'], redirect: ['good', 'Simple page, quick decision'], social: ['good', 'Offer something free and useful'], display: ['weak', 'Low click rates for cold sign-ups'], search: ['weak', 'Few people search for a page they have never heard of'] },
tip: 'Ask for the email only. Every extra field costs sign-ups. Follow up by email; most people join on a later message.' },
{ key: 'opp', name: 'Crypto or team-build opportunity', ex: 'an on-chain team build, a crypto earning program',
fit: { native: ['good', 'Explain it through your story, check each network\'s crypto rules first'], push: ['good', 'Curiosity hook to a pre-sell or squeeze page, never straight to a buy'], inpage: ['good', 'Same as push'], pop: ['weak', 'Cold and skimming; only to a free squeeze page'], display: ['weak', 'Too much to explain in a banner'], redirect: ['weak', 'No pre-sell'], search: ['avoid', 'Google and Microsoft restrict crypto and income offers'], social: ['avoid', 'Facebook restricts crypto and money-making ads; accounts get banned'] },
tip: 'Capture the email first and explain by email or video. No income promises in ads or pages; networks reject them and they draw complaints.' },
{ key: 'ads', name: 'Advertising tools and ad credits', ex: 'InstantAdPay, LinkSpin, traffic tools',
fit: { search: ['best', 'People search for "buy website traffic" and "advertise my site"'], push: ['good', '"Free ad credits" is a strong hook'], pop: ['good', 'Send to a free join that gives credits'], inpage: ['good', 'Same as push'], native: ['good', 'A how-I-get-traffic story'], social: ['good', 'Target small business owners and marketers'], display: ['weak', 'Fine for retargeting'], redirect: ['weak', 'Rarely the right audience'] },
tip: 'Sell the free starting credits, not the plan. "Get your first ads seen free" beats "join my business".' },
{ key: 'games', name: 'Games and play-to-earn', ex: 'browser games, game rewards',
fit: { pop: ['best', 'Gamers click fast; send to the game itself'], inpage: ['best', 'Mobile-heavy, quick tap to play'], push: ['good', 'Short, playful headlines'], social: ['good', 'Short gameplay video'], native: ['weak', 'Readers are not in play mode'], display: ['weak', 'Only with an eye-catching game image'], redirect: ['weak', 'Hit and miss'], search: ['weak', 'Only for the game\'s own name'] },
tip: 'Land them in the game, not on a sign-up wall. Let them play first and ask for an account when they win something.' },
{ key: 'software', name: 'Software, apps and AI tools', ex: 'an AI writer, a page builder, an app',
fit: { search: ['best', 'High intent: people search for the job the tool does'], native: ['good', 'Review-style or how-to articles'], social: ['good', 'Show the tool working in a short video'], push: ['good', 'A free trial or free tool hook'], inpage: ['good', 'Same as push'], display: ['weak', 'Retargeting only'], pop: ['weak', 'Low attention for a tool that needs a demo'], redirect: ['weak', 'Rarely the right audience'] },
tip: 'Lead with the free trial or free version and one clear result ("write a week of posts in 5 minutes").' },
{ key: 'info', name: 'Courses and info products', ex: 'a course, an ebook, a coaching program',
fit: { native: ['best', 'Story pre-sell to a free lesson'], social: ['good', 'Free lesson or webinar invite'], search: ['good', 'How-to keywords'], push: ['good', 'Only through a pre-lander'], inpage: ['good', 'Only through a pre-lander'], pop: ['weak', 'Too cold for a paid course'], display: ['weak', 'Retargeting only'], redirect: ['weak', 'No pre-sell'] },
tip: 'Give a free first lesson for an email, then sell by email. Cold traffic rarely buys a course on the first visit.' },
{ key: 'sweeps', name: 'Giveaways and freebies', ex: 'a contest, a free gift, a spin-to-win',
fit: { pop: ['best', 'The classic pop offer'], push: ['best', '"You could win" headlines work'], inpage: ['best', 'Same as push'], redirect: ['good', 'Quick entry form'], display: ['good', 'A clear prize image'], native: ['weak', 'Pricey clicks for a freebie'], social: ['weak', 'Strict contest rules on social'], search: ['avoid', 'Almost nobody searches for it'] },
tip: 'Show the prize and the deadline. Keep the entry to one field and say clearly what happens next.' },
];
// formats each catalog network sells (by catalog key). adult: 'mixed' = big adult inventory with mainstream
// options (pick mainstream / non-adult in the targeting), 'adult' = mostly adult sites.
// strict: mainstream ad policies (crypto, income claims, MLM are restricted or need approval).
const NETWORKS = {
'7search-ppc': { f: ['search', 'display'], note: 'Small search network, cheaper and less strict than Google' },
activerevenue: { f: ['pop', 'push', 'inpage', 'native'] },
adskeeper: { f: ['native'], note: 'Native network from the MGID family' },
adsterra: { f: ['pop', 'inpage', 'display', 'native'], note: 'Social Bar is its in-page push format' },
bidvertiser: { f: ['pop', 'push', 'native', 'display'] },
clickadu: { f: ['pop', 'inpage', 'push', 'display'] },
exoclick: { f: ['pop', 'display', 'native', 'push', 'inpage'], adult: 'mixed' },
ezmob: { f: ['pop', 'push', 'native', 'display'] },
facebook: { f: ['social'], strict: true },
froggyads: { f: ['pop', 'push', 'inpage', 'display'] },
'google-adwords': { f: ['search', 'display'], strict: true, note: 'Also YouTube video ads' },
hilltopads: { f: ['pop', 'inpage', 'display'] },
mgid: { f: ['native'], strict: true },
'microsoft-advertising': { f: ['search'], strict: true, note: 'Bing, Yahoo and partner search' },
mondiad: { f: ['push', 'inpage', 'native'] },
mybid: { f: ['pop', 'push', 'native', 'display'] },
plugrush: { f: ['pop', 'display', 'native'], adult: 'mixed' },
popads: { f: ['pop'] },
popcash: { f: ['pop'] },
propellerads: { f: ['pop', 'push', 'inpage'] },
pushground: { f: ['push', 'inpage'] },
reacheffect: { f: ['push', 'pop'] },
revcontent: { f: ['native'], strict: true },
taboola: { f: ['native'], strict: true },
tonic: { f: [], note: 'Mostly a search-monetization partner; confirm what traffic they sell before you spend' },
trafficjunky: { f: ['display', 'native'], adult: 'adult', note: 'Adult sites; also video pre-roll' },
trafficshop: { f: ['pop', 'display'], adult: 'mixed' },
trafficstars: { f: ['pop', 'display', 'native', 'push', 'inpage'], adult: 'mixed' },
ungads: { f: [], note: 'Check the ad formats in your account' },
zeropark: { f: ['pop', 'push', 'redirect', 'search'] },
};
const RULES = [
['Test small, then scale', 'Start each network with a small daily budget and one offer. Keep what converts, cut what does not, then raise the budget on the winners.'],
['Track every click', 'Set the network up under Sources so its click id and postback are on the link. Then Reports shows which network, zone and creative actually converts.'],
['Change one thing at a time', 'New headline or new page or new network, not all three at once, or you will not know what made the difference.'],
['Block the zones that waste money', 'Pop, push and native networks sell from thousands of sites. After a day or two, block the sites and zones with clicks and no sign-ups.'],
['No income promises', 'Ads and pages that promise earnings get rejected and draw complaints. Show what the program is and let people decide.'],
['Mainstream vs adult inventory', 'Networks marked adult-heavy sell a lot of adult traffic. Target their mainstream (non-adult) sites unless your offer fits that audience.'],
];
const fmtName = k => (FORMATS[k] || {}).short || k;
// the formats a source sells, and the offers those formats suit best (for the Sources screen line)
function bestFor(key) {
const n = NETWORKS[key]; if (!n || !n.f.length) return [];
return OFFERS.filter(o => n.f.some(f => o.fit[f] && o.fit[f][0] === 'best') && !(n.strict && o.key === 'opp') && !(n.adult === 'adult' && !['games', 'sweeps'].includes(o.key))).map(o => o.name);
}
return { FORMATS, OFFERS, NETWORKS, RULES, fmtName, bestFor };
})();
+52
View File
@@ -0,0 +1,52 @@
// LinkSpin Traffic guide page (2026-10-28): offer picker, the ad formats, the networks, ground rules.
(function () {
const G = window.TRAFFIC_GUIDE, $ = id => document.getElementById(id), esc = CR.esc;
CR.mount({ active: 'sources', crumb: 'Control room · Sources', title: 'Traffic guide', sub: 'which traffic for which offer', actions: '<a class="btn sm" href="/sources">&larr; Sources</a>' });
let CAT = [], OFF = null, NF = '';
const nameOf = k => { const c = CAT.find(x => x.key === k); return c ? c.name : k; };
const ORDER = ['best', 'good', 'weak', 'avoid'];
function tags(k) {
const n = G.NETWORKS[k] || { f: [] };
return n.f.map(f => '<span class="tag plain">' + esc(G.fmtName(f)) + '</span>').join('')
+ (n.adult === 'adult' ? '<span class="tag warn">adult sites</span>' : n.adult === 'mixed' ? '<span class="tag dim" title="Big adult inventory; target its mainstream sites">adult-heavy</span>' : '')
+ (n.strict ? '<span class="tag warn" title="Strict ad policy: crypto, income claims and MLM are restricted or need approval">strict policy</span>' : '');
}
function renderOffers() {
$('offers').innerHTML = G.OFFERS.map(o => '<button type="button" class="chip' + (OFF === o.key ? ' on' : '') + '" data-k="' + o.key + '">' + esc(o.name) + '</button>').join('');
$('offers').querySelectorAll('.chip').forEach(b => b.addEventListener('click', () => { OFF = OFF === b.dataset.k ? null : b.dataset.k; try { history.replaceState(null, '', OFF ? '#' + OFF : location.pathname); } catch (e) {} renderOffers(); renderResult(); }));
}
function renderResult() {
const o = G.OFFERS.find(x => x.key === OFF);
if (!o) { $('result').innerHTML = '<div class="muted">Pick one above.</div>'; return; }
const rows = Object.keys(o.fit).sort((a, b) => ORDER.indexOf(o.fit[a][0]) - ORDER.indexOf(o.fit[b][0]));
const good = rows.filter(f => o.fit[f][0] === 'best' || o.fit[f][0] === 'good');
// networks that sell at least one best/good format; strict-policy networks are left out for the opportunity offer
const nets = Object.keys(G.NETWORKS).filter(k => { const n = G.NETWORKS[k]; if (n.strict && o.key === 'opp') return false; if (n.adult === 'adult' && !['games', 'sweeps'].includes(o.key)) return false; // adult-only sites suit few offers return n.f.some(f => good.includes(f)); })
.map(k => ({ k, score: G.NETWORKS[k].f.reduce((s, f) => s + (o.fit[f] ? (o.fit[f][0] === 'best' ? 3 : o.fit[f][0] === 'good' ? 1 : 0) : 0), 0) }))
.sort((a, b) => b.score - a.score || nameOf(a.k).localeCompare(nameOf(b.k)));
$('result').innerHTML = '<div class="res"><div class="fit">'
+ rows.map(f => '<div class="r"><span class="fn">' + esc(G.FORMATS[f].name) + '</span><span class="rate ' + o.fit[f][0] + '">' + o.fit[f][0] + '</span><span class="why">' + esc(o.fit[f][1]) + '</span></div>').join('')
+ '</div><div style="display:grid;gap:12px;align-content:start"><div class="tipbox"><b>Tip.</b> ' + esc(o.tip) + '</div>'
+ '<div><div class="sec" style="margin-bottom:6px">Networks that sell those formats</div><div class="nets">' + nets.map(x => '<a href="#net-' + esc(x.k) + '">' + esc(nameOf(x.k)) + '</a>').join('') + '</div></div>'
+ (o.key === 'opp' ? '<div class="muted" style="font-size:12px">Google, Microsoft, Facebook, Taboola, Revcontent and MGID are left out: their policies restrict crypto and income offers.</div>' : '')
+ '</div></div>';
}
function renderFormats() {
$('fmts').innerHTML = Object.keys(G.FORMATS).map(k => { const f = G.FORMATS[k];
return '<div class="fmt" id="fmt-' + k + '"><h3>' + esc(f.name) + '</h3><p>' + esc(f.what) + '</p><p><b>How you pay:</b> ' + esc(f.buy) + '</p><p><b>Converts:</b> ' + esc(f.wins) + '</p><p><b>Struggles:</b> ' + esc(f.fails) + '</p><p><b>Landing page:</b> ' + esc(f.page) + '</p></div>'; }).join('');
}
function renderNets() {
const fs = Object.keys(G.FORMATS);
$('nfilter').innerHTML = '<button type="button" class="chip' + (NF ? '' : ' on') + '" data-f="">All</button>' + fs.map(f => '<button type="button" class="chip' + (NF === f ? ' on' : '') + '" data-f="' + f + '">' + esc(G.FORMATS[f].name) + '</button>').join('');
$('nfilter').querySelectorAll('.chip').forEach(b => b.addEventListener('click', () => { NF = b.dataset.f; renderNets(); }));
const keys = Array.from(new Set(CAT.map(c => c.key).concat(Object.keys(G.NETWORKS)))).filter(k => !NF || ((G.NETWORKS[k] || {}).f || []).includes(NF)).sort((a, b) => nameOf(a).localeCompare(nameOf(b)));
$('nrows').innerHTML = keys.length ? keys.map(k => { const n = G.NETWORKS[k] || { f: [] }, c = CAT.find(x => x.key === k) || {}, bf = G.bestFor(k);
return '<div class="rw" id="net-' + esc(k) + '"><div class="nm"><b>' + esc(nameOf(k)) + '</b><span>' + esc(c.site || '') + '</span></div><div class="tg2">' + (tags(k) || '<span class="muted" style="font-size:12px">check in your account</span>') + '</div>'
+ '<div class="note">' + (bf.length ? 'Best for: ' + esc(bf.join(', ')) + '. ' : '') + esc(n.note || '') + '</div></div>'; }).join('')
: '<div class="rw"><span class="muted">No network sells that format.</span></div>';
}
$('rules').innerHTML = G.RULES.map(r => '<div><b>' + esc(r[0]) + '</b><span>' + esc(r[1]) + '</span></div>').join('');
OFF = (location.hash.slice(1) && G.OFFERS.some(o => o.key === location.hash.slice(1))) ? location.hash.slice(1) : null;
renderOffers(); renderResult(); renderFormats(); renderNets();
CR.get('/api/sources/catalog').then(r => { CAT = r.catalog || []; renderResult(); renderNets(); }).catch(() => {});
})();