Paddle affiliate tracking, in one line of code.
Paddle affiliate tracking with AffiliateTracking takes one line in your checkout and one webhook in Paddle. On cloud, one API key adds that webhook for you. First sales, renewals, refunds and chargebacks all land in the same ledger.
Renewals credit the same affiliateChargebacks claw backCloud and self-host
// Before you open Paddle checkout
const token = window.AffiliateTracking
&& AffiliateTracking.token();
Paddle.Checkout.open({
items: [{ priceId: 'pri_...', quantity: 1 }],
...(token ? { customData: { token } } : {}),
});
The only code change a Paddle checkout needs.
From click to commission
How a Paddle sale finds its affiliate
The same path as every other sale, with Paddle's custom data carrying the token.
- 01The click
A visitor opens an affiliate's link. AffiliateTracking records the click and sends them to your site with a signed token.
- 02The script keeps it
t.js saves the token in a cookie on your domain for your attribution window, 30 days unless you change it.
- 03Checkout carries it
Your code passes the token to Paddle as custom data. Paddle keeps it on the transaction.
- 04Paddle tells us
transaction.completed arrives, the 13 fraud rules run, and the customer stays linked to that affiliate.
Set up Paddle
Step 2 is the only code. On cloud, step 3 is one API key and step 4 disappears.
-
Add the script to your site
Paste it on every page, right before </head>. Your workspace settings show the tag with your own address filled in.
<script src="https://yourbrand.affiliatetracking.co/t.js" async></script>
-
Pass the token at checkout
Add the line from the example above where you call Paddle.Checkout.open. Only send it when there is one, and keep every custom data value as text.
// Inside Paddle.Checkout.open({ ... }) ...(token ? { customData: { token } } : {}), -
Connect Paddle
On cloud, create a Paddle API key with one permission, Notification settings: Write, and paste it under Connect your billing. AffiliateTracking adds the notification destination, sandbox or live. On self-host, add the destination yourself: your address and three events. Paddle then shows its secret key.
# Address https://yourbrand.affiliatetracking.co/webhooks/paddle # Events transaction.completed adjustment.created adjustment.updated
-
Self-host: set the secret key
Set it as AE_PADDLE_SECRET and restart. It starts with pdl_ntfset_. On cloud, the API key connect keeps it for you. AffiliateTracking checks every event against it before it writes anything.
# Self-host AE_PADDLE_SECRET="pdl_ntfset_..." # Cloud Nothing to paste. Connect keeps it.
What each Paddle event does
Each event has to pass Paddle's signature check, and it counts once, however many times Paddle sends it.
| Paddle event | What AffiliateTracking does |
|---|---|
transaction.completed, first sale | Reads the token, credits the affiliate and links the customer to them for good. |
transaction.completed, later | Renewals and upgrades credit the linked affiliate. No token needed. |
transaction.completed, $0 | Skipped. A free trial earns on its first paid transaction. |
adjustment.created, adjustment.updated | An approved refund or chargeback takes back the same share of the commission. Pending ones wait. |
Good to know before you start
Four details worth knowing before you go live.
Trials and the window
A trial earns on its first paid transaction, if that still carries the token and falls inside your attribution window.
Renewals need no token
Once a customer has an affiliate, every later transaction credits that same affiliate, with no custom data needed.
Refunds wait for approval
Paddle adjustments count once Paddle approves them. A pending refund changes nothing yet.
Send the token as text
Pass exactly what AffiliateTracking.token() returns, as a text value. Don't reformat it.
Where Paddle sales show up
Each paid sale becomes a journal in the partner's ledger, in the sale's own currency. A refund adds a second journal that takes the share back. Nobody edits a journal after the fact.
Partners see the same entries in their portal, with proof that every journal sums to zero. Read how commission tracking works on the ledger.
Paddle FAQ
How do I run an affiliate program on Paddle?
Paddle takes the payments and AffiliateTracking tracks who sent each one. Add the script to your site, pass the token when you open checkout, and point a Paddle webhook at your workspace. Then invite affiliates.
Do I need a developer?
For one line, yes. Paddle checkout opens from your own code, so whoever wrote that adds the token. Everything after that happens in settings.
Is this Paddle Billing or Paddle Classic?
Paddle Billing, the current version with transaction and adjustment events. It doesn't support Paddle Classic.
Do renewals keep paying the affiliate?
Yes. The first affiliate to bring a customer keeps them, so every paid renewal after credits the same person, as long as they're still active.
What happens when Paddle refunds a customer?
Once Paddle approves the refund, the same share of the commission comes back. If you already paid the affiliate, it comes off their next payout.
Does Paddle pay my affiliates?
No. AffiliateTracking works out who's owed what, and you pay them yourself through PayPal, Wise or your bank. The list of every billing tool shows what else connects.
Can I test with the Paddle sandbox?
Yes. On cloud, paste a sandbox API key (it starts with pdl_sdbx_apikey_) and the destination goes to sandbox. Use a separate workspace for it, so test sales stay out of your real ledger.
Your Paddle checkout,
now with affiliates.
Self-host for free: the code is open source. Or let us run it for you.