Paddle checkout attribution: carry the channel in custom_data
Pass the marketing channel into a Paddle Billing checkout with customData, then read it from transaction.completed on every renewal. 7 steps, code and limits.
Muzahid Maruf, FounderUpdated
On this page
Explore with AI
Opens this article inside the chosen assistant with a ready-made prompt.
Paddle checkout attribution is the practice of storing the marketing source on a Paddle Billing checkout, so every payment can be credited to a channel. Put the source into the checkout's custom data before the buyer pays.
On Paddle Billing, the source goes in a customData object in the checkout open call, or in custom_data on a transaction your server creates.
Paddle Billing copies the object to the subscription and returns it in the transaction.completed webhook, so the channel is still attached on payment 12. Paddle Classic calls the same field passthrough.
According to the Paddle developer docs, accounts created before August 8, 2023 run on Paddle Classic, and later accounts run on Paddle Billing.
Without the hand-off, a $49 monthly plan sold through 1 newsletter link loses $588 of yearly revenue from the channel report. The 7 steps below run from the landing page to the sandbox test, with code for each.
Key takeaways
- Attach the marketing source as custom data when the checkout opens or when your server creates the transaction, and Paddle Billing copies it to the subscription and every renewal.
- On Paddle Billing, overlay and inline checkouts run on your own page, so UTM parameters stay readable at purchase. Hosted checkout has 14 URL parameters and none takes custom data.
- Custom data in Paddle Billing needs at least 1 key and has no published size cap. A transaction freezes once it is billed, canceled or completed, and refunds arrive as adjustments with no custom data.
Where does Paddle checkout attribution get lost?
Paddle checkout attribution gets lost at the hand-off between your page and the transaction. The usual explanation blames a redirect that strips UTM parameters, a problem Google Analytics 4 setups also know well.
On Paddle Billing, the overlay checkout guide shows the overlay opening as a modal on your page, and an inline checkout sits inside the page layout, so your script still reads the query string and cookies.
A Paddle Billing transaction records the buyer, price, tax and payment method. A transaction records nothing about the ad behind the click.
Hosted checkout is the exception, because Paddle built the hosted page for mobile apps and its 14 URL parameters include none for custom data.
For example, a newsletter click on Monday reaches the pricing page, and the buyer subscribes on Friday through an overlay. Only a saved source connects the 2 visits.
| Checkout type | Runs on | Where the source goes |
|---|---|---|
| Overlay | Your page, as a modal | customData in Paddle.Checkout.open() |
| Inline | Your page, embedded | The same call |
| Payment link | Your approved page, opened with ?_ptxn= | custom_data on a server-created transaction |
| Hosted checkout | A Paddle-hosted page built for mobile apps | Nowhere: its 14 URL parameters include none for custom data |
From the default payment link and hosted checkout pages of the Paddle Billing reference.
How do you pass the channel into a Paddle checkout?
Steps 1 and 2 cover an overlay or inline checkout. Step 3 replaces both when your server builds the transaction. Each route ends with 1 custom_data object on a transaction, copied to the subscription.
Step 1: Save the first source on the landing page
Navigation drops the query string before the buyer clicks Subscribe in Paddle Billing. Read the 4 UTM keys on the first pageview and keep the first source per visitor, written once and never overwritten by a later campaign.
const KEYS = ["utm_source", "utm_medium", "utm_campaign", "utm_content"];const params = new URLSearchParams(location.search); if (params.get("utm_source") && !localStorage.getItem("first_touch")) { const touch = {}; for (const key of KEYS) if (params.get(key)) touch[key] = params.get(key); localStorage.setItem("first_touch", JSON.stringify(touch));}Step 2: Pass it to Paddle.Checkout.open()
Keep the object flat, because Paddle Billing warns that nested values may display wrongly in the dashboard. An object needs at least 1 key, so send a marker such as none when nothing was saved.
function openCheckout() { const saved = JSON.parse(localStorage.getItem("first_touch") || "null"); Paddle.Checkout.open({ items: [{ priceId: "pri_01gs59hve0hrz6nyybj56z04eq", quantity: 1 }], customData: saved || { utm_source: "none" }, // an empty object is invalid });}Step 3: Or create the transaction on your server
Put custom_data in the Paddle Billing POST /transactions body. Set anything you act on, such as discounts or plan access, on the server, because a browser can send anything.
const res = await fetch("https://api.paddle.com/transactions", { method: "POST", headers: { Authorization: "Bearer " + process.env.PADDLE_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ items: [{ price_id: "pri_01gs59hve0hrz6nyybj56z04eq", quantity: 1 }], custom_data: { utm_source: "newsletter", utm_medium: "email", utm_campaign: "oct-launch" }, }),});const { data } = await res.json();// data.id is the txn_... ID for Paddle.Checkout.open({ transactionId }).// data.checkout.url is the payment link for the same transaction.Step 4: Which Paddle event carries the channel?
The transaction.completed event is the one to read. Paddle Billing fires the event once a transaction is fully paid and processed, with custom_data, subscription_id, currency_code and the totals, so write 1 row per payment.
The checkout.completed event in Paddle.js carries the same object for on-page tracking, such as a Google Analytics 4 purchase hit.
Store the amount as a pre-tax figure in minor units: a $49 payment becomes 4900, and the currency code travels with the row. The event_id is unique per notification, so a repeat delivery is easy to spot.
export async function POST(req: Request) { const raw = await req.text(); // verify Paddle-Signature against this raw body first const event = JSON.parse(raw); if (event.event_type !== "transaction.completed") return new Response("ok"); const t = event.data; await saveSale({ eventId: event.event_id, // unique per event: skip repeats transactionId: t.id, subscriptionId: t.subscription_id, // null for one-time prices currency: t.currency_code, subtotalMinor: t.details.totals.subtotal, // string in minor units source: t.custom_data?.utm_source ?? "missing", }); return new Response("ok");}Verify the Paddle-Signature header first, as the signature verification guide lays out, then answer with a 200 within 5 seconds. A handler that stores the sale but replies late gets the event again.
3 deliveries would count a $49 payment 3 times and credit the channel with $147. Dedupe on event_id.
Why does the subscription need the value too?
A Paddle Billing subscription needs the source because renewals are created from the subscription, not from the first transaction.
Paddle Billing copies a transaction's custom data to the subscription it creates, and a subscription's custom data to every transaction created from the subscription: renewals, upgrades, downgrades and one-time charges.
Take a $49 monthly plan sold through 1 newsletter link in Paddle Billing. 12 payments add up to $588. Storing the source on the first transaction alone credits 1 payment, or 8.3% of the year.
Storing the source on the subscription credits all 12 payments, or 100%. The carry-forward is what makes lifetime value by channel possible. Credit the pre-tax amount, because the total includes tax.
The transaction in the Paddle custom data guide carries a 20% rate: a subtotal of 300.00 GBP, tax of 60.00 and a total of 360.00.
| Where the source is stored | Payments credited | Newsletter revenue | Share of the year |
|---|---|---|---|
| First transaction only | 1 | $49 | 8.3% |
| Subscription as well | 12 | $588 | 100% |
One $49 monthly plan across 12 payments.
| Paddle Billing field | Minor units | Amount in GBP | Against the subtotal |
|---|---|---|---|
| details.totals.subtotal | 30000 | 300.00 | 100% |
| details.totals.tax | 6000 | 60.00 | 20% |
| details.totals.total | 36000 | 360.00 | 120% |
The totals in the Paddle Billing custom data guide example.
Step 5: Which refunds reduce the channel?
A refund in Paddle Billing is an adjustment, and Paddle Billing never edits the original sale for an adjustment. The adjustments guide records the refund against the completed transaction, announced by adjustment.created and later by adjustment.updated.
The payload carries transaction_id and subscription_id but no custom_data. Join on the transaction ID to the row saved in step 4.
Live refunds start as pending_approval, and Paddle Billing approves some refunds itself, such as 400 USD or less on a verified account. Subtract a refund once the status is approved.
In the example table, the newsletter earns $98 gross and $88 net after a $10 refund, which is 47.1% of the $187 net total. The affiliate sale earns $99, or 52.9%, and the youtube sale refunds to $0.
Chargebacks arrive as the same kind of adjustment, with 3 actions: chargeback_warning, chargeback and chargeback_reverse.
| Sale | Payment | Source | Approved refund | Net for the channel |
|---|---|---|---|---|
| Sale 1 | $49 | newsletter | none | $49 |
| Sale 2 | $49 | newsletter | $10 | $39 |
| Sale 3 | $99 | affiliate | none | $99 |
| Sale 4 | $29 | youtube | $29 | $0 |
A worked example with 4 sales.
| Channel | Sales | Gross | Refunds | Net | Share of net |
|---|---|---|---|---|---|
| newsletter | 2 | $98 | $10 | $88 | 47.1% |
| affiliate | 1 | $99 | $0 | $99 | 52.9% |
| youtube | 1 | $29 | $29 | $0 | 0% |
| Total | 4 | $226 | $39 | $187 | 100% |
The same 4 sales grouped by the source saved at checkout.
Step 6: What fixes subscribers who already paid?
Fixing existing subscribers means editing the Paddle Billing subscription, because Paddle Billing freezes a billed, canceled or completed transaction. Send PATCH /subscriptions/{subscription_id} with a custom_data object, and every later transaction created from the subscription carries the value.
Match existing subscribers to your own click records by email, then write the source onto each subscription. Payments already taken stay blank in Paddle Billing.
For 1,000 subscribers, the job takes 5 list calls plus 1,000 updates, about 4.2 minutes at the limit of 240 requests a minute per IP address. After a 429 response, the address waits 60 seconds.
Page sizes shape the job too: transactions return 30 rows per page, and subscriptions default to 50 with a cap of 200, so 1,000 subscriptions take 5 pages.
If your handler was down, Paddle Billing can replay a failed notification through the API.
Step 7: Does the setup work in the sandbox?
Paddle Billing sandbox testing is 1 purchase with a known source, checked in 3 places. Buy once in the Paddle sandbox with utm_source=newsletter in the landing URL.
Then look for the value in the checkout.completed callback, the transaction.completed body and the subscription.created body. Absent from all 3 means the checkout call never sent the value.
Present in the webhook but absent from your database means the handler reads the wrong field.
Sandbox webhooks retry 3 times within 15 minutes, against up to 60 retries over 3 days in live mode, so a broken handler shows failures quickly.
Live webhooks retry up to 60 times over 3 days, with 20 retries in the first hour and 47 in the first day.
Buy again with an affiliate link and a youtube link, so the report shows 3 sources instead of 1.
Which numbers shape the setup?
The numbers come from 6 Paddle documentation pages, and each number changes 1 design choice, from the marker value to the page size of a bulk update.
| What | Value | Why it matters |
|---|---|---|
| Keys in a custom data object | At least 1 | An empty object is invalid, so send a marker |
| UTM keys saved per visitor | 4 | utm_source, utm_medium, utm_campaign and utm_content |
| Steps from landing page to sandbox test | 7 | Each step ends in 1 verifiable row or call |
| Published size cap on custom data | None | Store an ID and a few short keys |
| Kinds of entity that accept custom data | 8 | Only transactions and subscriptions are documented as copying to each other |
| Transaction statuses | 7 | Edits stop once a transaction is billed, canceled or completed |
| Webhook response deadline | 5 seconds | A 200 inside the window stops retries |
| Active notification destinations | 10 | Remove one to add an 11th |
| Active notification destinations | 10 | Remove one to add an 11th |
From the custom data, rate limiting, pagination, webhook delivery and migration docs for Paddle Billing and the Paddle Classic checkout parameters, read in October 2026.
What is Paddle Classic passthrough?
Passthrough is the Paddle Classic field for custom order data, a string of up to 1,000 characters sent with every webhook for the order. The habit is JSON inside the string, parsed on the way back.
Paddle's data mapping turns passthrough into both transaction.custom_data and subscription.custom_data on Paddle Billing, so keep your key names when you migrate. Accounts created before August 8, 2023 start on Paddle Classic, and later accounts get Paddle Billing.
The first step of a Paddle Billing migration is to list every key your Paddle Classic code writes into passthrough, then confirm the Paddle Billing handler reads the same keys from custom_data.
A key renamed in the middle of a migration splits 1 channel into 2 rows in the report. Send the same keys on both versions during the move, so 1 report covers old and new subscribers.
What keeps the source alive until the buyer pays?
Keeping the source alive means surviving Safari's storage limits. Step 1 keeps the source in localStorage, and Safari Intelligent Tracking Prevention limits localStorage.
According to WebKit's tracking prevention policy, script-created cookies, IndexedDB and sessionStorage are deleted after 7 days without user interaction. Script-written cookies on a landing page with link decoration are capped at 24 hours.
Someone who clicks a newsletter link on Monday and returns directly 9 days later arrives with nothing saved, and the checkout sends the marker.
Set the visitor ID from your server's response header, because the 7-day rule is written about script-created storage. Pass the buyer's email into checkout as a second match key.
Hosted checkout cannot help here, because the hosted page accepts no custom data. The Safari ITP post goes deeper, and Stripe users do the same job with checkout metadata.
| Storage | Safari rule |
|---|---|
| Cookies created in JavaScript, plus localStorage, IndexedDB and sessionStorage | Deleted after 7 days without user interaction |
| Script-written cookies on a landing page with link decoration | Capped at 24 hours |
How does TrackRev read Paddle custom data?
TrackRev is SaaS affiliate software with revenue attribution built in. We built TrackRev so the pixel keeps a visitor ID in a first-party cookie named vid and exposes the ID as window.trk.vid.
Passing the ID to Paddle Billing is the whole page-side integration.
Paddle.Checkout.open({
items: [{ priceId: "pri_01gs59hve0hrz6nyybj56z04eq", quantity: 1 }],
customer: { email: user.email },
customData: { vid: window.trk.vid },
});| Setting | What TrackRev does |
|---|---|
| Visitor ID | Cookie vid lasts 365 days and is written by JavaScript, so Safari's 7-day rule applies |
| Join key | custom_data.vid on each transaction, with the buyer's email as the fallback |
| API key | Read-only, with Customer, Product, Subscription, Transaction and Discount access |
| Sync | Every hour, or within seconds with a notification destination on transaction.completed and transaction.refunded |
| Partner codes | A Paddle discount code assigned to an affiliate credits that partner without a click |
| Paddle version | Paddle Billing only |
| Plans | Revenue attribution starts at $29 a month on Indie, with Growth at $299 a year |
How TrackRev handles Paddle Billing sales.
TrackRev reads the vid from each transaction and falls back to the buyer's email, so the channel survives a cleared cookie.
We use the email as the second join key because a cookie can vanish between click and payment, and we sync Paddle Billing every hour by default.
Paddle Billing is the only supported version, and the connect screen warns against a Paddle Classic key. Revenue attribution starts at $29 a month on the Indie plan, with Growth at $299 a year.
If all you need is the channel in your own database, the handler above does the job with 1 webhook and 1 table in 2026. We built the 2 paid plans so neither Indie nor Growth caps tracked revenue.
Sellers on Paddle Classic need another route, and Paddle Billing is the only version covered here. The Paddle integration page, pricing and Paddle revenue attribution by marketing channel have the setup screens, plans and reporting.
Found this useful? Share it.
Frequently asked questions
- Passthrough is the Paddle Classic field, a string of up to 1,000 characters. Custom_data is the Paddle Billing JSON object, accepted by 8 kinds of entity, and the Paddle Billing migration mapping turns the first into the second.
- Paddle Billing publishes none for keys or total size. It requires at least 1 key and rejects a number above an unstated maximum with a 400 error.
- Use transaction.completed. The earlier transaction.paid event fires before Paddle Billing finishes processing the transaction.
- Paddle Billing documents copying only between transactions and subscriptions. Customers have a custom_data field of their own.
- No. The connect screen asks for a Paddle Billing API key and warns against a Classic key.
- No. The free plan has 50 links and 1,000 tracked events a month, covers link tracking only and hides revenue figures.

Written by
Founder, TrackRev.io & Contant.io
Muzahid Maruf founded TrackRev.io, SaaS affiliate software with no limit on tracked revenue, and Contant.io. He writes about affiliate programs.
Writes about Marketing attribution · Link tracking · Revenue analytics · SaaS growth
Run your affiliate program without a revenue cap.
Affiliate software for indie hackers and small SaaS teams: $29 a month flat, 0% fees, link tracking and revenue attribution built in. Free to start, no card.