Files
linkspin/public/conversions.html
martbost b84eed3be5 Theme switch: auto | light | dark, stored in localStorage ls.theme and on the account, applied before first paint on every page
themehead.js is the one source of the tiny inline head script (and of AUTO_DEFAULT, the one constant Marty decides later: 0 = nothing stored keeps the page's current look, light for Control Room and public pages, dark for the sapphire pages; 1 = follow the device). The script sets data-theme on <html> from ls.theme (auto follows prefers-color-scheme and tracks changes live) and exposes window.LSTheme. tools/stamp-theme-head.cjs writes it into every static page before the first stylesheet with data-theme-base on <html>; blog, leaderboard, what's-new, the badge page, the unsubscribe page and the wall 404 read the module directly. The site CSP allows inline scripts by hash only, so themehead.CSP_HASH joins script-src (the script was silently blocked until then).

Account side: accounts.theme (JSON store and MySQL, alterSafe column), in the public account JSON and /api/me; POST /api/my/profile {theme} rides the existing profile save path and never touches the username. cr-shell.js renders a Light / Dark / Auto segmented control in the topbar of every Control Room screen and paints every .theme-seg on the page (the Profile pane gains an Appearance card with the same control); a click applies at once, saves locally and to the account when signed in; at sign-in the account value wins over the local one, and a local choice is pushed up when the account has none yet. view.html stops reading an undefined --bg so its light variant has a light stage. ?v= tags bumped on every changed stylesheet and script (20261101t / ls20261101t).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-01 10:44:40 -06:00

76 lines
8.3 KiB
HTML

<!doctype html>
<html lang="en" data-theme-base="light">
<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>Conversions · LinkSpin</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"light",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("ls.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.LSTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("ls.theme",c);else localStorage.removeItem("ls.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("ls-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<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=20261101t">
<style>
.body{padding:16px 24px;display:grid;gap:16px}
.two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.panel{align-content:start}
.range{display:flex;border:1px solid var(--line-strong);border-radius:var(--r);overflow:hidden;background:var(--panel-2)} .range button{background:transparent;border:0;color:var(--muted);font-family:var(--mono);font-size:12px;padding:5px 10px;cursor:pointer} .range button.on{background:var(--ink);color:var(--on-ink)}
.goals .hd,.goals .rw{grid-template-columns:minmax(0,1fr) 120px 70px 90px 150px;gap:8px;align-items:center}
.camps .hd,.camps .rw{grid-template-columns:minmax(0,1fr) 92px 60px 56px 60px 90px;gap:8px}
.lst .hd,.lst .rw{grid-template-columns:minmax(0,1fr) 60px;gap:8px}
.meth{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.meth .m{background:var(--panel-2);border:1px solid var(--line);border-radius:6px;padding:8px 10px;display:grid;gap:2px}
.meth .m .k{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)} .meth .m .v{font-family:var(--display);font-weight:700;font-size:20px}
.snip{display:grid;gap:6px;margin-top:10px} .snip .code{display:block;font-size:12px;line-height:1.6;padding:10px 12px;overflow-wrap:anywhere;white-space:pre-wrap}
.steps{margin:6px 0 0;padding-left:20px;display:grid;gap:6px}
.gsel{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.pill{font-family:var(--mono);font-size:11px;padding:1px 7px;border-radius:3px;background:var(--panel-2);border:1px solid var(--line)}
@media (max-width:900px){.two{grid-template-columns:1fr}.body{padding:12px 16px}.goals .hd{display:none}.goals .rw{grid-template-columns:minmax(0,1fr) auto;row-gap:4px}.camps .hd,.camps .rw{grid-template-columns:minmax(0,1fr) 60px 44px 44px 64px;font-size:12px}.camps .hd span:nth-child(2),.camps .rw span:nth-child(2){display:none}.meth{grid-template-columns:repeat(2,minmax(0,1fr))}}
</style>
</head>
<body>
<div id="page">
<div class="body">
<div class="panel">
<div class="ph" style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px"><h2>Your goals</h2><button class="btn pri" type="button" id="addGoal">Add a goal</button></div>
<div class="muted" style="margin:4px 0 10px">A goal is something you want counted: a subscriber, a sale, a sign-up. Each goal has its own pixel id. The id is public and safe to paste: it can only count clicks that are yours.</div>
<div class="tbl goals"><div class="hd"><span>Goal</span><span>Pixel id</span><span class="r">Value</span><span class="r">Counted</span><span></span></div><div id="goalRows"></div></div>
</div>
<div class="two">
<div class="panel">
<h2>Set it up in 3 steps</h2>
<div style="margin:2px 0 6px"><a href="/conversion-tracking" target="_blank" rel="noopener">How to set it up: the step-by-step guide with copy-paste examples (WordPress, page builders, Aweber, GetResponse)</a></div>
<ol class="steps">
<li><b>Landing page:</b> paste the landing tag once, before &lt;/body&gt;. It keeps the click id on your own site for 30 days.</li>
<li><b>Thank-you page:</b> paste the goal pixel for the goal (the image works anywhere; the script version is surer).</li>
<li><b>Test it:</b> press <b>Send a test conversion</b> below. To check your real thank-you page, add <span class="mono">&amp;test=1</span> to its pixel, open the page once, and the last test time updates (take it back out afterwards). Your own clicks on your ads, spin links and Banner Spins are kept as tests and never counted, so finishing your own form proves nothing in the counts.</li>
</ol>
<div class="gsel" style="margin-top:12px"><span class="muted">Snippets for</span><select class="field" id="goalPick" style="width:auto;min-width:160px"></select><button class="btn" type="button" id="testBtn">Send a test conversion</button><span class="muted" id="testNote"></span></div>
<div class="snip"><span class="sec">1. Landing tag</span><code class="code mono" id="snTag"></code><div><button class="btn sm" type="button" data-copy="snTag">Copy</button></div></div>
<div class="snip"><span class="sec">2. Goal pixel (image)</span><code class="code mono" id="snImg"></code><div><button class="btn sm" type="button" data-copy="snImg">Copy</button></div></div>
<div class="snip"><span class="sec">2b. Goal pixel (script, reads what the landing tag kept)</span><code class="code mono" id="snJs"></code><div><button class="btn sm" type="button" data-copy="snJs">Copy</button></div></div>
<div class="muted" style="margin-top:8px">Add <span class="mono">&amp;value=19.95</span> to the pixel to record what the sale was worth. Without it, the goal's default value is used.</div>
</div>
<div class="panel">
<h2>Autoresponders and hosted thank-you pages</h2>
<div class="ink2" style="display:grid;gap:8px">
<p style="margin:0">If your list provider shows its own thank-you page, you cannot paste the pixel there. Point the provider at a page on <b>your</b> site instead, and put the pixel on that page.</p>
<p style="margin:0"><b>Aweber:</b> open your sign-up form, go to its settings, set <b>Thank You Page</b> to a custom page and paste your page's address.</p>
<p style="margin:0"><b>GetResponse:</b> in the form or landing page settings, set the <b>thank-you page</b> to a custom URL and paste your page's address.</p>
<p style="margin:0">If you cannot change it, the pixel can still count through LinkSpin's cookie or the 24-hour match, just less surely.</p>
<p style="margin:0"><b>Forms on your own page:</b> add a hidden field named <span class="mono">lsclk</span> and the landing tag fills it with the click id, so your own system can pass it on.</p>
<p style="margin:0"><b>Postbacks:</b> a postback set to the event <span class="mono">goal</span> (on <a href="/links">Links</a> or a <a href="/sources">traffic source</a>) fires for every goal, with <span class="mono">{event}</span> = the goal's name.</p>
</div>
</div>
</div>
<div class="panel">
<div class="ph" style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px"><h2>How sure is each count</h2><span class="muted" id="totalNote"></span></div>
<div class="meth" id="methRows"></div>
<div class="muted" style="margin-top:8px"><b>Address</b>: the click id was on the thank-you page's address. <b>Kept</b>: the landing tag kept it on your site. Both are exact. <b>Cookie</b>: LinkSpin's own cookie, exact but some browsers block it. <b>24 h match</b>: same network and browser within a day of the click, a good guess, not proof. Each goal counts once per click, only within 30 days of the click, and only for clicks on your own ads and links.</div>
</div>
<div id="goalReports"></div>
</div>
</div>
<script src="/assets/cr-shell.js?v=20261101t"></script>
<script src="/assets/conversions.js?v=20261026a"></script>
</body>
</html>