Repository navigation
v2.32.0
Leads carry money. Send a value and a currency with a sale, from Stripe, any payment tool
through Zapier, Make or n8n, or your own server, and Leads & sales > Revenue shows which
sources, pages, campaigns and AI assistants made money, with refunds, renewals and lifetime
value. Each currency stays its own; nothing is converted. Every figure is counted twice.
Stripe users: add invoice.paid, invoice_payment.paid and charge.refunded to the
Skald endpoint's events for renewals and refunds.
Added: revenue on leads
- Server: money on every lead, counted and recounted. The
leadandjsonhooks, the
lead files (PHP, Node, Python) and the WordPress plugin'sskald_leads_leadfilter take optionalvalueandcurrency
(ISO 4217, kept as whole minor units),customer_refandtags, and a new stagerefunded.
A bad one is dropped with a note in the answer and the delivery log, never refused. Stripe
now keeps the amount, currency, customer and payment intent of each checkout, and reads
invoice.paidrenewals andcharge.refunded(one refund row per sale, raised to Stripe's
running total). conversions.json gains per-dayrevenueper currency (gross, refunded, net;
sales, refunds, new customers, renewals; by source, first source, campaign, landing, country,
device, tool, label, tag),currenciesandltv(lifetime value by first source).
Currencies are never converted. GET/traffic-hooks/<site>/leads,skald conversions list
and the lead drawer return the value, currency, customer ref and tags. conversions.sqlite
goes to schema 9: the table is rebuilt for the new stage, every row kept with its id, test
mark, label and identity, a copy of the old file kept first (conversions.sqlite.v8.bak);
store.py's tables moved toconversions/schema.py.
Why: the owner wants Skald to say which source, page, campaign and AI assistant made
money, without an adapter per payment tool. Who: sites that send a value, and Stripe
users. Do: nothing to keep working. For revenue, sendvalueandcurrencywith paid
leads, and subscribe the Stripe endpoint toinvoice.paid,charge.refundedand
invoice_payment.paidtoo.
Checked:audit_revenue.pyrecounts every figure by its own SQL and re-sums the money
from the hook spool with its own reader; a day either disagrees with is withheld,ltvtoo.
New tests (tests/test_revenue.py, tests/test_lead_files.py) cover the field rules and notes,
the schema 9 rebuild of a schema 8 file built in the test, Stripe renewals, partial and
out-of-order refunds and ISK, two currencies and JPY, test and removed rows, the audit
agreeing on good data and withholding a changed sale or refund, the reconcile GET, the CLI
list, the lead drawer, and the Python helper passing the new arguments. - Server: fixes from an independent review, before release. The review found eight
defects in the money. (1) Stripe sendscharge.refundedfor every charge of the account; a
refund with no sale kept was subtracted under "Unknown". A refund now counts only on its
counted sale, in its currency; any other is kept, never subtracted, and shown in the new
conversions.jsonrefunds_without_sale({count, currencies}: every refund row no figure
counts, also one kept without a value; see the second review below). (2) A refund that came
before its sale was counted twice once raised (1000, the checkout, then 3000 gave 4000), and
a whole refund sent first stayed without a value: the sale now takes over every refund that
waited for it, and fills in a whole one's value. (3) Stripe's API 2025-03-31 ("basil") took
payment_intentoff the Invoice andinvoiceoff the Charge, so a renewal's refund could not
find its sale: Skald now readsinvoice_payment.paid(Stripe's InvoicePayment, itsinvoice
andpayment.payment_intent) and keeps the link (pay_links); older payloads still work.
(4) A refund was not checked against its sale (500 on a 49.99 sale gave net -400.02; a EUR
refund on a USD sale opened a EUR block): it is now cut to the sale's value, or kept without
a value in another currency, each with a note to the sender. (5) Tags kept555-123-4567,
555.123.4567and192.0.2.10: a tag value with 7 or more digits in all or shaped like an
IPv4 address, and a personal key (phone,email,ip...), is now dropped, in the store and
the spool alike (conversions.tag). (6) Decimal's 28-digit precision rounded
49.990000000000000000000000000000000001to 49.99 while the second count refused it, and the
day was withheld: amounts are now read with exact integer arithmetic. (7) The WordPress plugin
tookskald_value,skald_currencyandskald_customer_reffrom the visitor's own form
post, so anyone could post any amount: removed; money comes only from the server-side
skald_leads_leadfilter, and$_POSTis read throughwp_unslash. (8) A raised refund
was counted on the first refund's day, so a raise more than 30 days later showed in no
period: each part of a refund is now kept with its own time (refund_parts) and counts on
the day it arrived;refundscounts the refunds that arrived. Who: sites that send
refunds or use Stripe, and WordPress sites. Do: subscribe the Stripe endpoint to
invoice_payment.paid; a WordPress site that put money in hidden form fields moves it to the
skald_leads_leadfilter. Checked: tests/test_revenue_review.py, a test per defect
through both counting roads (it failed before each fix: 22 of its tests), a table of 34
hostile amounts read alike by both readers, the reviewer's own probe scripts rerun, and the
full suite. - Server and dashboard: fixes from a second independent review, before release. (1) Every
okday before a site's first value carriedrevenue: {}, a "known none" for days when
amounts were simply not sent, and revenue per visitor counted those days' visitors: revenue
is now recorded from the local day of the first row with a value, given as conversions.json's
newrevenue_since; a day before it has norevenueat all. The second count finds that day
with its own reader and checks it, and that each day carries a block exactly from then. The
Revenue tab says "Values are recorded from ", and leaves out any day before it. (2) An
amount of more than 4,300 digits raised an error and lost the delivery (a json batch lost
every record): amount text over 30 characters is now never parsed, in both readers, and the
lead is kept without a value, with a note; a huge JSON number is read as text. (3, 4) The
spool recount applied a removal to the whole spool, before or after it happened, and missed
a refund that had moved onto its sale: each removal is now replayed at the time it happened,
on the row's ref at that time, so removing a sale, a sale removed and sent again, and a moved
refund removed all agree with the store instead of withholding the day. (5) A refund kept
without a value (another currency than its sale, or unreadable) was counted nowhere: it is
now listed inrefunds_without_saleon both roads, and the tab's line says which refunds it
holds. (a) A refund with an unreadable value, then a whole refund, then the sale: the whole
refund was answered as a duplicate; it now waits for the sale's value and counts. (b) A
refund of 0 counted as one refund in the Refunds tile: a refund or a part of 0 is no refund.
(c)customer_refkept198.51.100.7and15551234567: a reference shaped like an IP
address, or of only digits and+ ( ) . -with 7 or more digits, is now dropped with a note,
in the store and the spool (ids such ascus_9,c_10293847and UUIDs are kept). The docs
now also say that a refund that came before its sale and is cut or emptied when the sale
arrives gets no note. Who: sites that send money. Do: nothing. Checked:
tests/test_revenue_rereview.py, a test per finding through both roads (16 of its first 17 tests
failed or errored before the fixes, the 18th before its own), tests/js/revenue.mjs for the
tab, the reviewer's probe scripts and the schema 8 upgrade probe rerun, and the full suite. - Dashboard: Leads & sales > Revenue. A new tab after Sources answers "which sources, pages
and campaigns made money?": net revenue (sold less refunded), sales, refunds, new customers,
renewals and revenue per visitor (net revenue over the visitors of the same checked days,
given over at least 10 visitors), then net revenue and sales by source, first touch,
campaign, landing page, country, device, tool, label or tag, and a folded lifetime value by
first source. Each currency is its own set of figures, picked with a Currency switch; the
others are listed under the numbers as "Also in this period, never added". A withheld day is
left out and said in the conversions' own words; a site that never sent a value gets the
how-to. The currency, the breakdown and the tag are in the address (cur,by,tag), and
each landing page has its copy and open icons;tag=planalone lists every value of that tag.
The Refunds tile says each refund counts on the day it arrives and a later, larger total
counts the difference on its own day, and a line under the table counts the refunds kept
without a counted sale (refunds_without_sale), never taken off. Money uses the file's own
decimals (currencies). Why: the server side above gives the
figures; this is where people read them. Who: every site; it says "No revenue yet" until
a value arrives. Do: nothing. Checked: tests/js/revenue.mjs (money per currency in
minor units, JPY and KWD decimals, withheld and not-recorded days, never adding USD and EUR,
the address, copy and open, the empty state, refunds without a sale,tag=plan), run from tests/test_navigate_js.py; walked in
a browser on the demo at 1440 and 390 px, light and dark. - Dashboard: a lead's drawer shows its sale. Value (with its currency), what was refunded
on it, the customer reference with a copy icon, and its tags, only when the lead carries
them. Why: to see one sale's money beside its journey. Who: sites that send a value.
Do: nothing. Checked: tests/js/revenue.mjs; the demo's trials paid for annual plans. - Docs and help. A new help guide, Revenue (
docs/help/revenue.md, in the app's Help and
at /docs/revenue/ on the website), anddocs/INTEGRATIONS-REVENUE.md: the fields, renewals,
refunds as the total refunded so far (a later, larger total counts the difference on its own day), the tag rules, amounts in cents divided by 100, and recipes for
Zapier, Make and n8n, with the field names of Polar, Dodo Payments, Paddle, Lemon Squeezy and
Gumroad cited from each one's own webhook documentation (and "check your tool's payload"
where a tool's refund carries only its own amount). Webhooks, Send leads from your backend,
Leads & sales,docs/INTEGRATIONS.md,docs/ROUTES.md, the README's feature list and
docs/COMPARISON.md(a revenue row, checked 2026-10-24 for GA4 and Plausible only) say the
same. Why: the brief asked for every document in the same release. Who: anyone
setting revenue up. Do: nothing. Checked: tests/test_help.py, tests/test_about.py,
tools/build-about.pyrun; each tool's field names read from its docs on 2026-10-24. - Demo: sample sales.
tools/demo.pygives its Stripe checkouts amounts in USD and EUR,
Stripe customers, monthlyinvoice.paidrenewals for one in three and a part refund; and the
site's server sends trials through the lead hook that are paid 14 days later for an annual
plan, with a customer reference and the tagsplanandbilling. Each sale carries its
visit's touch, so revenue splits by source. Picked by the sale's number, never from the seeded
draws, so the rest of the demo is as it was. Why: the live demo and the README screenshot
show the Revenue tab with real figures from the real pipeline. Who: the demo only. Do:
nothing. Checked: the demo built, its second counts agreeing (no day withheld). - Website. Stripe payment attribution: a new fold follows one sample customer through a
paid Checkout, a renewal, a part refund and the refund raised to the whole sale; the hero
now shows the amount, currency, customer ID and payment intent as read, and the set-up, the
limits and the FAQ name the five events (withinvoice_payment.paid). Zapier, Make, n8n: a fold maps Polar, Dodo, Paddle, Lemon Squeezy
and Gumroad sales (amount in cents, divided by 100). Backend lead file: a fold shows which
money fields Skald keeps or drops and the answer's own note. Lead attribution: revenue by
source, per currency. The features page names revenue. Why: the pages said Skald never
reads amounts, which is no longer true. Who: website readers. Do: nothing. Checked:
the site's build ends "problems: none" with every rubric check passing on these pages.
Tests: the set-up checklist test no longer depends on the machine it runs on
- Fixed.
tests/test_setup_checklist.pyasked the real port 127.0.0.1:8766 whether a
beacon helper was running, so it failed whenever anything listened there (on 2026-10-24 a
preview web server did, and the suite failed on unchanged code too). It now points the
check at a port that refuses, the "no helper" state it was written for. Who: people
running the tests. Do: nothing. Checked: the test passes with a server on 8766. - Fixed. The first publish of 2.32.0 stopped before anything went out: the public copy
ran a test of the website's Markdown pages without the website builder it tests (that
builder is not public), and the release check flagged the older changelog split out to
docs/CHANGELOG-2.23-2.26.mdbecause it names the company, as the main changelog may.
That test now stays in the private repo, and split-out changelogs follow the main
changelog's rule. Who: no one outside; nothing was published. Do: nothing.
Checked: the publish-tool tests, then the publish's own sweep and full test run.
Full release notes: docs/CHANGELOG-2.32-2.34.md › 2.32.0