Fuel flow IAP -> LinkSpin made obvious (Marty 2026-10-25: "I clicked set up conversion tracking, it took me to LinkSpin and I don't know how to pick up from there"). Engine Room links now follow the site the member is on (engine.js build({site})): Set up conversion tracking on InstantAdPay opens /my#conversions (Campaigns > Conversion tracking card, scrolled to, highlighted, goal box focused; same goals LinkSpin counts) with the /conversion-tracking guide beside the button; buy/refuel/top-up and the Fuel part stay on this site. Only LinkSpin-only tools cross over (Banner Spin -> /links#b, spin link, page, testing), labelled "on LinkSpin" and tagged ?from=iap&task=<job> so LinkSpin shows an arrival strip with Step 1. Streak line and Refuel card get a "Refuel LinkSpin" link to linkspin.app/credits#refuel when the second engine is still open. Part labels wrap cleanly. Chatbot canned + prompt routes, KNOWLEDGE_DATE 2026-10-25. engine.js / engine-room.js stay byte-identical with LinkSpin. QA: fuel 12/12 engine incl. new site-links test, member walk 0 bugs. my.js, fuel.js, engine-room.js ?v=20261025ff.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,9 +11,16 @@
|
||||
const DAY = 86400000;
|
||||
const n0 = v => (typeof v === 'number' && isFinite(v) ? v : Number(v) || 0);
|
||||
const LINKS = {
|
||||
iapBuy: 'https://instantadpay.com/my#buy', iapCampaigns: 'https://instantadpay.com/my#campaigns', iapTracking: 'https://instantadpay.com/my#campaigns',
|
||||
lsBuy: 'https://linkspin.app/credits', lsAds: 'https://linkspin.app/ads', lsLinks: 'https://linkspin.app/links', lsPages: 'https://linkspin.app/pages', lsConv: 'https://linkspin.app/conversions',
|
||||
iapBuy: 'https://instantadpay.com/my#buy', iapCampaigns: 'https://instantadpay.com/my#campaigns', iapTracking: 'https://instantadpay.com/my#conversions',
|
||||
lsBuy: 'https://linkspin.app/credits#buy', lsAds: 'https://linkspin.app/ads', lsLinks: 'https://linkspin.app/links', lsBanner: 'https://linkspin.app/links#b', lsPages: 'https://linkspin.app/pages', lsConv: 'https://linkspin.app/conversions',
|
||||
};
|
||||
// 2026-10-25 (Marty: "the flow from InstantAdPay to LinkSpin is confusing"): every link points at the screen on the site the
|
||||
// member is ON when that site can do the job (buy, campaigns, conversion goals: InstantAdPay's Campaigns > Conversion
|
||||
// tracking card writes the same LinkSpin goals). Only LinkSpin-only tools (Banner Spin, spin links, pages) cross over, and
|
||||
// engine-room.js tags those links with ?from=<site>&task=<key> so LinkSpin shows an arrival strip with the first step.
|
||||
const linksFor = site => site === 'linkspin'
|
||||
? { buy: LINKS.lsBuy, campaigns: LINKS.lsAds, tracking: LINKS.lsConv }
|
||||
: { buy: LINKS.iapBuy, campaigns: LINKS.iapCampaigns, tracking: LINKS.iapTracking };
|
||||
const ACTIVE = new Set(['active', 'paused']);
|
||||
|
||||
// credits a day across recent campaigns: what each delivered over the days it has run (30 at most), summed
|
||||
@@ -26,7 +33,7 @@ function burnPerDay(camps, now) {
|
||||
}
|
||||
return b;
|
||||
}
|
||||
function part(state, label, note, link) { return { state, label, note, link }; }
|
||||
function part(state, label, note, link, key) { return { state, label, note, link, key }; }
|
||||
|
||||
function build(o) {
|
||||
const now = o.now || Date.now();
|
||||
@@ -36,6 +43,7 @@ function build(o) {
|
||||
const camps = sites.flatMap(f => (f.campaigns || []).map(c => Object.assign({ site: f.site }, c)));
|
||||
const recent = camps.filter(c => ACTIVE.has(c.status) || now - n0(c.created) <= 30 * DAY || c.status === 'out');
|
||||
const locked = !rf.started;
|
||||
const here = o.site === 'linkspin' ? 'linkspin' : 'iap', L = linksFor(here);
|
||||
// ---- dial 1: fuel left vs this cycle's refuel ----
|
||||
const left = sites.reduce((s, f) => s + n0(f.credits && f.credits.available) + n0(f.credits && f.credits.inCampaigns), 0);
|
||||
const cy = rf.cycle || null;
|
||||
@@ -67,34 +75,36 @@ function build(o) {
|
||||
];
|
||||
// ---- the six parts ----
|
||||
const P = (lsF && lsF.parts) || {};
|
||||
const pFuel = !camps.length ? part('grey', 'Fuel', 'no ads yet', LINKS.iapCampaigns)
|
||||
: out.length && !running.length ? part('amber', 'Fuel', 'nothing running', LINKS.iapCampaigns)
|
||||
: low.length || (daysLeft != null && daysLeft < 5) ? part('amber', 'Fuel', daysLeft != null && daysLeft < 5 ? 'about ' + daysLeft + ' days left at your burn' : 'an ad is running low', LINKS.iapBuy)
|
||||
: running.length ? part('green', 'Fuel', running.length + ' ad' + (running.length === 1 ? '' : 's') + ' running', LINKS.iapCampaigns) : part('amber', 'Fuel', 'nothing running', LINKS.iapCampaigns);
|
||||
const pick = (k, label, link) => { const x = P[k]; return x ? part(x.state, label, x.note, link) : part('grey', label, lsF ? 'not set up' : 'LinkSpin did not answer', link); };
|
||||
const parts = [pFuel, pick('bannerSpin', 'Banner spin', LINKS.lsLinks), pick('spinLink', 'Spin link', LINKS.lsLinks), pick('page', 'Page', LINKS.lsPages), pick('testing', 'Testing', LINKS.lsLinks),
|
||||
lsF ? (n0(lsF.goalsCount) === 0 ? part('grey', 'Conversion tracking', 'no goal set', LINKS.lsConv) : n0(lsF.conv30) === 0 ? part('amber', 'Conversion tracking', 'no conversions tracked yet', LINKS.lsConv) : part('green', 'Conversion tracking', n0(lsF.conv30) + ' in 30 days', LINKS.lsConv))
|
||||
: part('grey', 'Conversion tracking', 'LinkSpin did not answer', LINKS.iapTracking)];
|
||||
const pFuel = !camps.length ? part('grey', 'Fuel', 'no ads yet', L.campaigns, 'ads')
|
||||
: out.length && !running.length ? part('amber', 'Fuel', 'nothing running', L.campaigns, 'ads')
|
||||
: low.length || (daysLeft != null && daysLeft < 5) ? part('amber', 'Fuel', daysLeft != null && daysLeft < 5 ? 'about ' + daysLeft + ' days left at your burn' : 'an ad is running low', L.buy, 'refuel')
|
||||
: running.length ? part('green', 'Fuel', running.length + ' ad' + (running.length === 1 ? '' : 's') + ' running', L.campaigns, 'ads') : part('amber', 'Fuel', 'nothing running', L.campaigns, 'ads');
|
||||
const pick = (k, label, link, key) => { const x = P[k]; return x ? part(x.state, label, x.note, link, key) : part('grey', label, lsF ? 'not set up' : 'LinkSpin did not answer', link, key); };
|
||||
const parts = [pFuel, pick('bannerSpin', 'Banner spin', LINKS.lsBanner, 'bannerspin'), pick('spinLink', 'Spin link', LINKS.lsLinks, 'spinlink'), pick('page', 'Page', LINKS.lsPages, 'page'), pick('testing', 'Testing', LINKS.lsLinks, 'testing'),
|
||||
lsF ? (n0(lsF.goalsCount) === 0 ? part('grey', 'Conversion tracking', 'no goal set', L.tracking, 'conversions') : n0(lsF.conv30) === 0 ? part('amber', 'Conversion tracking', 'no conversions tracked yet', L.tracking, 'conversions') : part('green', 'Conversion tracking', n0(lsF.conv30) + ' in 30 days', L.tracking, 'conversions'))
|
||||
: part('grey', 'Conversion tracking', 'LinkSpin did not answer', L.tracking, 'conversions')];
|
||||
// ---- one next move ----
|
||||
const per1000 = c => n0(c.delivered) >= 200 ? n0(c.clicks) / n0(c.delivered) * 1000 : null;
|
||||
const ranked = running.filter(c => per1000(c) != null).sort((a, b) => per1000(b) - per1000(a));
|
||||
const linkFor = c => c.site === 'linkspin' ? LINKS.lsAds : LINKS.iapCampaigns;
|
||||
const availAll = sites.reduce((s, f) => s + n0(f.credits && f.credits.available), 0);
|
||||
let next;
|
||||
if (locked) next = { key: 'start', label: 'Refuel to start your engine', why: 'Your first counted refuel ($' + (rf.minUsd ? rf.minUsd.iap : 20) + '+ here or $' + (rf.minUsd ? rf.minUsd.linkspin : 25) + '+ on LinkSpin) starts the streak and lights this room.', link: LINKS.iapBuy };
|
||||
else if (rf.windowOpen) next = { key: 'refuel', label: 'Refuel now', why: 'Your refuel window is open: +' + rf.next.single + '% on one site, +' + rf.next.both + '% on each with both.', link: LINKS.iapBuy };
|
||||
const mIap = rf.minUsd ? rf.minUsd.iap : 20, mLs = rf.minUsd ? rf.minUsd.linkspin : 25;
|
||||
const firstWhy = here === 'linkspin' ? 'A package of $' + mLs + ' or more here (or $' + mIap + '+ on InstantAdPay) starts the streak and lights this room.' : 'A package of $' + mIap + ' or more here (or $' + mLs + '+ on LinkSpin) starts the streak and lights this room.';
|
||||
if (locked) next = { key: 'start', label: 'Refuel to start your engine', why: firstWhy, link: L.buy, guide: '/refuel' };
|
||||
else if (rf.windowOpen) next = { key: 'refuel', label: 'Refuel now', why: 'Your refuel window is open: +' + rf.next.single + '% on one site, +' + rf.next.both + '% on each with both. A $' + (here === 'linkspin' ? mLs : mIap) + '+ package here counts.', link: L.buy, guide: '/refuel' };
|
||||
else if (out.length && !running.length && availAll >= 100) next = { key: 'relaunch', label: 'Relaunch an ad', why: 'Nothing is running and you have ' + Math.round(availAll).toLocaleString('en-US') + ' credits free.', link: linkFor(out[0]) };
|
||||
else if (daysLeft != null && daysLeft < 5) next = { key: 'pitstop', label: 'Top up' + (rf.pitStop && (rf.pitStop.iap || rf.pitStop.linkspin) ? ' (Pit Stop +' + rf.pitStop.pct + '%)' : ''), why: 'About ' + daysLeft + ' days of fuel left at your current burn.', link: LINKS.iapBuy };
|
||||
else if (daysLeft != null && daysLeft < 5) next = { key: 'pitstop', label: 'Top up' + (rf.pitStop && (rf.pitStop.iap || rf.pitStop.linkspin) ? ' (Pit Stop +' + rf.pitStop.pct + '%)' : ''), why: 'About ' + daysLeft + ' days of fuel left at your current burn.', link: L.buy };
|
||||
else if (low.length) { const best = low.slice().sort((a, b) => (per1000(b) || 0) - (per1000(a) || 0))[0]; next = { key: 'topup', label: 'Top up the winner', why: '"' + (best.name || 'your ad') + '" is past 80% of its budget.', link: linkFor(best) }; }
|
||||
else if (parts[5].state === 'grey') next = { key: 'tracking', label: 'Set up conversion tracking', why: 'Count signups and sales back to the ad that sent them.', link: parts[5].link };
|
||||
else if (parts[1].state === 'grey') next = { key: 'bannerspin', label: 'Make a Banner Spin', why: 'Test up to 5 banners in one ad slot and let the winner show.', link: LINKS.lsLinks };
|
||||
else if (parts[4].state !== 'green') next = { key: 'testing', label: 'Test A against B', why: 'Add a second page to your spin link so the rotation can pick a winner.', link: LINKS.lsLinks };
|
||||
else if (parts[5].state === 'grey') next = { key: 'tracking', label: 'Set up conversion tracking', why: here === 'linkspin' ? 'Count signups and sales back to the ad that sent them. Step 1: add a goal, then paste its two snippets on your pages.' : 'Count signups and sales back to the ad that sent them. Step 1: add a goal under Campaigns > Conversion tracking, then paste its two snippets on your pages.', link: parts[5].link, guide: '/conversion-tracking' };
|
||||
else if (parts[1].state === 'grey') next = { key: 'bannerspin', label: 'Make a Banner Spin', why: 'Test up to 5 banners in one ad slot and let the winner show.' + (here === 'linkspin' ? '' : ' Banner Spin is a LinkSpin tool: the same email signs you in there.'), link: LINKS.lsBanner };
|
||||
else if (parts[4].state !== 'green') next = { key: 'testing', label: 'Test A against B', why: 'Add a second page to your spin link so the rotation can pick a winner.' + (here === 'linkspin' ? '' : ' Spin links live on LinkSpin: the same email signs you in there.'), link: LINKS.lsLinks };
|
||||
else if (ranked.length >= 2 && per1000(ranked[0]) > per1000(ranked[ranked.length - 1]) * 1.5) { const worst = ranked[ranked.length - 1]; next = { key: 'cut', label: 'Cut the loser', why: '"' + (worst.name || 'an ad') + '" brings the fewest clicks per 1,000 credits. Pause it and move the credits to "' + (ranked[0].name || 'your best ad') + '".', link: linkFor(worst) }; }
|
||||
else next = { key: 'cruise', label: 'Keep it running', why: 'Every part is lit. Check again on your refuel day.', link: LINKS.iapCampaigns };
|
||||
else next = { key: 'cruise', label: 'Keep it running', why: 'Every part is lit. Check again on your refuel day.', link: L.campaigns };
|
||||
return {
|
||||
on: true, locked, fuel, clicks, goals,
|
||||
streak: { active: !!rf.active, months: rf.streak || 0, best: rf.best || 0, refuelDay: rf.refuelDayLabel || null, graceEnd: rf.graceLabel || null, windowOpen: !!rf.windowOpen, next: rf.next || null, pitStop: rf.pitStop || null, freeMiss: rf.freeMiss || null, both: !!(cy && cy.both), note: streakNote(rf, cy) },
|
||||
warnings, parts, next, sites: { iap: !!(o.iap && o.iap.ok), linkspin: !!(o.ls && o.ls.ok) }, at: now,
|
||||
warnings, parts, next, site: here, sites: { iap: !!(o.iap && o.iap.ok), linkspin: !!(o.ls && o.ls.ok) }, at: now,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user