Conversion tracking fixes (Marty approved 2026-10-26): real test pixel, own-click count, own-browser clicks as tests, cost per goal (30 days)

1. Own clicks: auth.onSeen notes the soft key of every InstantAdPay session (lsconv.noteSession, once per 6 h per email + soft key) and the click push carries them as owners [{owner, sk, ts}] (requeued on a failed push), so LinkSpin keeps members' own clicks on their ads, spin links and Banner Spins as tests. /api/ads/click flags a click self for conversions when signed in as the owner OR from a browser the owner signs in from; whether the click is counted and billed is unchanged (still the signed-in check). Linked positions share the owner's email.
2. Send a test conversion now loads the member's real LinkSpin pixel in test mode from the browser (cv.gif?px=..&test=1, reads X-LS-Result: test, the same request LinkSpin's button makes) and falls back to the signed partner call (op test) when the browser cannot load it; CSP connect-src adds https://linkspin.app. The card shows "N from your own clicks, kept as tests and left out" (selfTests from LinkSpin's summary).
4. Cost per goal (30 days): /api/my/conversions returns spend30 = each campaign's spend over the same 30 days from credit_log (ads.spendSince: delivery, login, buy, refund rows by Central day, ref = campaign id). Campaign lines read "Goals and cost per goal (30 days)"; a campaign started inside the window with no log rows uses its spend since start (labelled in the tooltip); an older campaign with no spend on record shows no cost rather than a lifetime figure.
Copy: Conversion tracking card note, /conversion-tracking (test button, own clicks, cost per goal (30 days) row). Chatbot CANNED + FACTS, KNOWLEDGE_DATE 2026-10-26. my.js ?v=20261026cv.
QA: convpixel all passed (new: owners pushed without raw IP, own-browser click self=1 and stranger 0, no re-push within 6 h, spend30 = 200 of the window with the 40-day-old row and another member left out, 50/200 credits each vs lifetime 75, no-log old campaign shows no cost, new campaign uses spend since start, own-click count on the card, test button loads cv.gif?px&test=1 in the browser (routed locally) and falls back to op test); fuel all pass (engine.js / engine-room.js / kit.js untouched, byte-identical with LinkSpin); member walk 0 bugs; public 0 bugs (known /shorts ellipsis warning).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-26 06:31:18 -05:00
parent 27d663ca29
commit 06f0a87452
9 changed files with 138 additions and 37 deletions
+2 -2
View File
@@ -646,7 +646,7 @@
<li><b>LinkSpin cookie</b> (cookie): fairly sure. Matched through LinkSpin's own cookie in the visitor's browser. Some browsers block it.</li>
<li><b>24-hour match</b> (soft): least sure. Same connection and browser within 24 hours of a click. A good guess, not a proof.</li>
</ul>
<p class="small muted" style="margin:8px 0 0">Each goal counts once per click, only within 30 days of a real click on one of your ads. Your own clicks on your ads and the test button count as tests, never in your numbers.</p>
<p class="small muted" style="margin:8px 0 0">Each goal counts once per click, only within 30 days of a real click on one of your ads. Your own clicks (on your ads here, and on your LinkSpin spin links and Banner Spins) and the test button count as tests, never in your numbers. Send a test conversion loads your real pixel in test mode. Cost per goal (30 days) = the credits a campaign spent in the same 30 days, divided by its goals.</p>
</div>
<div class="card ad-foot" id="adSlotPane-campaigns" hidden></div>
</div>
@@ -1223,7 +1223,7 @@
<script src="/assets/wallet.js?v=20260911a"></script>
<script src="/assets/promo.js?v=20261016p"></script>
<script src="/assets/support.js?v=20261016a"></script>
<script src="/assets/my.js?v=20261025pr"></script>
<script src="/assets/my.js?v=20261026cv"></script>
<script src="/assets/fuel.js?v=20261025ff"></script>
<script src="/assets/engine-room.js?v=20261025ff"></script>
<script src="/assets/chat.js?v=20261016n"></script>