Revenue attribution
revenue-attributionUTM tags and referrers saved at checkout into Creem metadata, a webhook ledger keyed by transaction, and a report of who actually paid by channel, net of refunds and checked against Creem.
Full description
Shows which channels bring paying customers, not just visits. A first-party cookie records the first and last touch (UTM tags, referral code, referrer host, landing path; no personal data), the checkout route copies it into the Creem checkout metadata, and the webhook writes every payment, renewal, refund and dispute once into a small SQLite ledger with its channel. A report prints checkouts, orders, conversion and net-of-tax revenue per channel, source or campaign, per currency, first or last touch; a reconcile script compares the ledger with Creem's transaction list and finds missed webhooks and refunds. Ships a zero-dependency core, Next.js App Router files, 14 offline tests, a template check and privacy-policy text in English and Chinese. Use when the user asks where buyers come from, which channel or campaign pays, wants UTM tracking tied to revenue, revenue by source, or to check webhook revenue against Creem.
A sample Next.js app in Creem test mode: four visitors arrive from X, a newsletter, Google and Product Hunt, three pay with the test card, then one payment is refunded through the Creem CLI and the ledger is checked against Creem. · Recorded 2026-11-03
- 1Visitor 1 comes from a post on X and pays $9 a month in the Creem test checkout (sped up 2x)
- 2Visitor 2 from the newsletter buys Lifetime for $149, visitor 3 from Google buys Pro (sped up 3x)
- 3Visitor 4 from Product Hunt opens the checkout and leaves without paying
- 4The 15 offline tests pass, and the report shows checkouts, orders and revenue for each channel
- 5The Google payment is refunded with the Creem CLI; the refund webhook lands on search, and reconcile confirms the ledger matches Creem
Previews
What it does
UTM tags and referrers saved at checkout into Creem metadata, a webhook ledger keyed by transaction, and a report of who actually paid by channel, net of refunds and checked against Creem.
- A small first-party cookie keeps the first touch and the last non-direct touch: UTM tags, ref codes, click ids and the referrer host, sorted into paid, affiliate, email, social, community, search, referral or direct
- No personal data and no full URLs: emails, phone numbers and long tokens are dropped, only the path is kept, and a consent flag can switch capture off
- The checkout route copies the touches into Creem checkout metadata as flat strings, so they come back on checkout.completed, subscription.paid, refund.created and dispute.created
- A webhook ledger keyed by Creem transaction id: the first subscription payment counts once even though Creem sends two events, renewals are flagged, and refunds and disputes go against the channel of the original payment
- revenue_report.mjs: funnel and money by channel, source or campaign, first or last touch, per currency and net of tax; CSV and JSON output
- reconcile_creem.mjs checks the ledger against Creem's transaction list (missing payments, amount and refund gaps) and can backfill missed webhooks as unknown
Use the revenue-attribution skill to track which channel brings paying customers to my Next.js app on Creem, and give me a report of revenue by channel after refunds.Full instructions are included with purchase
This is a paid skill. Buy it on its own or get every skill with a plan. Buyers download it from this page or their account.
Outline
- 01When to use / when not to
- 02What you get
- 03Steps
- 04Rules
- 05Done when
- 06Troubleshooting
What's inside
26 files: SKILL.md, 6 scripts, 8 references, 10 templates and assets, 1 tests.
- SKILL.md9.3 KB
assets/(10)41.2 KB
lib/(2)32.1 KB
- attribution-core.mjs12.3 KB
- revenue-ledger.mjs19.8 KB
nextjs/(8)9.2 KB
src/(7)8.9 KB
app/(2)3.6 KB
api/(2)3.6 KB
checkout/(1)2.2 KB
- route.ts2.2 KB
webhooks/(1)1.4 KB
creem/(1)1.4 KB
- route.ts1.4 KB
components/(1)798 B
- Attribution.tsx798 B
lib/(4)4.5 KB
- attribution-core.d.mts1.6 KB
- current-user.ts222 B
- revenue-ledger.d.mts1.7 KB
- revenue.ts1022 B
- .env.example263 B
references/(8)20.3 KB
fixtures/(5)12.0 KB
- checkout.completed.json3.0 KB
- dispute.created.json2.8 KB
- README.md375 B
- refund.created.json3.0 KB
- subscription.paid.json2.8 KB
- channel-rules.md3.1 KB
- creem-attribution.md3.2 KB
- privacy.md2.0 KB
scripts/(7)26.8 KB
template-check/(1)3.1 KB
- routes.test.ts3.1 KB
- _db.mjs768 B
- check_nextjs_template.sh2.2 KB
- reconcile_creem.mjs2.6 KB
- revenue_report.mjs1.0 KB
- selftest.mjs15.3 KB
- send_test_webhook.mjs1.8 KB
Questions
What does Revenue attribution do?
UTM tags and referrers saved at checkout into Creem metadata, a webhook ledger keyed by transaction, and a report of who actually paid by channel, net of refunds and checked against Creem.
Which agents does it work with?
Claude Code, Codex, Cursor and any other agent that reads the Agent Skills format (a folder with SKILL.md). Paste the install prompt into your agent, or unzip the folder into its skills directory.
What is in the download?
26 files: SKILL.md, 6 scripts, 8 references, 10 templates and assets, 1 tests.
How much is it?
$6.99 one-time on its own, with 12 months of updates. Yearly and lifetime plans include every paid skill.
Can I get a refund?
A first payment can be refunded in full within 14 days if no paid skill was downloaded. After a download, no refund unless a skill is defective and we can't fix it.
How do updates work?
One-time purchases get 12 months of updates; yearly and lifetime get updates while active. Download again from this page or your account. Current version: 1.0.0.


