diff --git a/netsites.js b/netsites.js index 521663c..aba1ebf 100644 --- a/netsites.js +++ b/netsites.js @@ -37,7 +37,7 @@ function list() { if (Date.now() - cache.at > TTL) refresh(); return cache.list; // entry also gets go = the LinkSpin network link for that site with ?src=, so a click shows in LinkSpin Reports under the // site that sent it (LinkSpin netlinks.js: fixed codes on the admin account). This site = NETWORK_SITE_ID, else the request host. // No go for this site itself, or when this site cannot be told (a test host): the page then uses the plain url. -const CODES = { iap: 'nwiap', linkspin: 'nwls', dlb: 'nwdlb', vbb: 'nwvbb', viraladblitz: 'nwvab', fivex: 'nw5x', downlinehydra: 'nwdh', stackpol: 'nwsp', earnerscorner: 'nwec' }; +const CODES = { iap: 'nwiap', linkspin: 'nwls', dlb: 'nwdlb', vbb: 'nwvbb', viraladblitz: 'nwvab', viraladsource: 'nwvas', fivex: 'nw5x', downlinehydra: 'nwdh', stackpol: 'nwsp', earnerscorner: 'nwec' }; const linksBase = () => String(process.env.NETWORK_LINKS_BASE || 'https://linkspin.app').trim().replace(/\/+$/, ''); const hostOf = u => { try { return new URL(u).hostname.toLowerCase().replace(/^www\./, ''); } catch (e) { return ''; } }; function selfId(req, l) { diff --git a/promokit.js b/promokit.js index ec1fa46..fe1144c 100644 --- a/promokit.js +++ b/promokit.js @@ -52,19 +52,22 @@ function kit(u) { // the member's own page is their link (viraladsource.com/); a wallet falls back to ?ref= const link = ref && !/^0x/i.test(ref) ? base() + '/' + encodeURIComponent(ref) : base() + '/' + (ref ? '?ref=' + encodeURIComponent(ref) : ''); const q = ref ? '?ref=' + encodeURIComponent(ref) : ''; - const fill = s => s.split('{{LINK}}').join(link); const track = seg => netsites.tracked(C.siteId, C.siteId, { s1: ref, s2: seg }); + // what members paste (copy + creatives): the LinkSpin-tracked link (Marty 2026-11-17, nwvas) to their own page, so clicks show in + // LinkSpin Reports; linkspin.app/r/nwvas?src=viraladsource&s1=&s2= lands on viraladsource.com/?ref=. Plain page if no code. + const share = (ref && !/^0x/i.test(ref) ? track(ref) : track('')) || link; + const fill = s => s.split('{{LINK}}').join(share); const t = copy(); return { - v: 1, site: C.site, name: C.siteName, updated: '2026-11-16', username: ref || null, + v: 1, site: C.site, name: C.siteName, updated: '2026-11-17', username: ref || null, tagline: 'Every ad has a source. Watch yours travel.', links: [ - { key: 'page', label: 'Your page', url: link, tracked: track('') }, + { key: 'page', label: 'Your page', url: link, tracked: share }, { key: 'boost', label: 'Boost', url: base() + '/boost' + q, tracked: track('boost') }, { key: 'ledger', label: 'Live ledger', url: base() + '/ledger' + q, tracked: track('ledger') } ], linkTemplate: base() + '/{username}', trackedTemplate: netsites.tracked(C.siteId, C.siteId) + '&s1={username}', - creatives: creatives().map(c => Object.assign({}, c, { html: 'ViralAdSource' })), + creatives: creatives().map(c => Object.assign({}, c, { link: share, html: 'ViralAdSource' })), lines: t.lines.map(fill), headlines: t.headlines, email: { subject: t.email.subject, body: fill(t.email.body) }, posts: t.posts.map(fill), note: NOTE, promotePage: base() + '/promote' };