Make sure Stripe sales are credited
Connect Stripe, choose which products pay commission, and make sure your checkout carries the referral so every sale reaches the right affiliate.
The tracking script tells affixo who sent a visitor. Stripe tells affixo that the visitor paid. For a sale to reach the right affiliate, affixo needs both, plus one link between them: your checkout has to carry the visitor's id, or the buyer's email has to match a tracked signup.
Connect Stripe#
Open Stripe & products
Go to SettingsMoneyStripe & products and click Connect Stripe.
Approve the connection
Sign in to the Stripe account that takes payments on your website and approve the connection. You come back to affixo and the page shows Connected.
Choose which products earn commission
Your Stripe products are imported. Leave commission on for products affiliates can promote and turn it off for the rest, so each shows Earning or Not earning. Then click Confirm product selection.
Use the Stripe account your customers actually pay. If you run more than one, connect the one your website's checkout charges.
Link the checkout to the click#
Once Stripe is connected, sales arrive on their own. The part that can silently fail is tying a sale back to the affiliate's click. How you do that depends on how your checkout starts. On the AI tool guides pages and in the setup steps, How do you take payments? lets you pick yours, and the install prompt then includes the right step:
| Your checkout | What it needs |
|---|---|
| Checkout Sessions (your server creates the session) | Send Affixo.getVisitorId() from the page to your server and set it as metadata.sa_visitor_id on the session. For subscriptions, also set it in subscription_data.metadata. |
| Payment Links | Add client_reference_id with the visitor id to the buy.stripe.com link when the visitor clicks, not when the page loads. |
| Buy Button | Set the client-reference-id attribute on the button from the visitor id, before the shopper clicks. |
| Pricing Tables | Set the client-reference-id attribute on the table. Every plan in it inherits the id. |
| GoHighLevel funnel or Hosted elsewhere | No Stripe code. The sale is matched by the buyer's email instead. See GoHighLevel, Kajabi and other checkouts. |
Not sure which you use? Leave it on Auto-detect and the prompt asks your AI tool or developer to look at the code and pick.
Here's what the Checkout Session version looks like on your server, with visitorId sent up from
the page:
const session = await stripe.checkout.sessions.create({
mode: 'subscription',
line_items: [{ price: PRICE_ID, quantity: 1 }],
metadata: { sa_visitor_id: visitorId },
subscription_data: { metadata: { sa_visitor_id: visitorId } },
success_url: 'https://example.com/thanks',
cancel_url: 'https://example.com/pricing',
})
Tip
For one-time payments (mode: 'payment'), also set customer_creation: 'always'. Stripe otherwise
creates no customer for a one-off purchase, so a repeat purchase by the same buyer can't be tied to
the first one. Don't add it in subscription mode, where Stripe always creates a customer.
Sales that don't need the visitor id#
Some sales are credited without any checkout code:
- Promo codes. A sale that uses a code you assigned to an affiliate goes to that affiliate. See Track sales from promo codes.
- Renewals. A renewal goes to whoever earned the first payment on that subscription.
- Email match. When the buyer's email matches someone an affiliate already referred, the sale can be matched on that.
You can see and reorder these methods under SettingsProgramAttribution & approvals, in Resolution precedence. The first method that matches wins.
Check it worked#
Run Test your tracking. Then open ReportsConversions: each sale shows the affiliate and how it was matched. A sale with no affiliate means the checkout isn't carrying the visitor id yet.
Note
A sale on a product marked Not earning is still recorded, but pays no commission. If a sale looks right but earned nothing, check the product first.
Related#
Questions
No. With Stripe connected, affixo records each sale from Stripe with the amount actually paid after discounts. A sale event in the browser never books money by itself. It's recorded as a lead with the buyer's email, which can help match the Stripe payment, so it's harmless if your AI builder adds one.
Yes, when your campaign pays on renewals. A renewal is credited to the affiliate who earned the first payment on that subscription. If you use Checkout Sessions, copy the visitor id into the subscription's metadata too, so renewals keep the link.
A refund or a chargeback in Stripe reverses the matching commission automatically, so you don't pay out on money you gave back.
Put the affixo visitor id in the Checkout Session's metadata as sa_visitor_id instead. affixo prefers its own id in metadata over another tool's client_reference_id.
New sales stop being tracked and credited the moment it disconnects. Commissions and history you already have are kept.
Still stuck?
Send us a note and a person will get back to you, usually within one business day.