Know what must work before you launch
Complete guide to tracking affiliate conversions with Stripe subscriptions, one-time payments, and recurring revenue
- Best fit
- Teams evaluating AffiliateBase for a Stripe affiliate workflow.
- Checkout handoff
- The checkout path must receive the generated AffiliateBase referral ID.
- Proof required
- Complete one referred checkout and confirm the attributed sale and commission.
Follow the attribution evidence
Illustrative scenario · fictional values
-
Referred visit
?via=partner
AffiliateBase captures the visit and generates a referral record.
-
Checkout handoff
referral ID
The checkout must carry the generated identifier into Stripe.
-
Paid event
$99 paid
A supported Stripe event confirms the attributed payment.
-
Commission
$19.80 due
An eligible attributed sale creates the commission record.
-
Payout prep
Payout ready
Review the commission and prepare the next step with your payout provider.
Create an affiliate program for your own Stripe business with AffiliateBase: connect payments to referred customers, apply commission rules, and give partners their own referral links. This guide is for merchants running a program; to refer businesses to Stripe itself, see Stripe partnerships.
Start with a Stripe account, an AffiliateBase campaign, and access to the page where visitors begin checkout. For Payment Links, keep the link and tracking script on the same page. For backend-created Checkout Sessions, your developer must send the generated referral ID from the browser to Stripe.
A tracked click does not prove a payment is attributed. Follow the Stripe checkout integration instructions, then confirm a referral, paid event, and commission using the verification checklist. For commission and payout requirements, start with the SaaS affiliate program launch guide.
Follow these steps to set up Stripe affiliate tracking:
Add the Tracking Script
<script async src="https://app.affiliatebase.io/track.js" data-account-id="YOUR_ACCOUNT_ID"></script>
Connect Your Stripe Account
Stripe Payment Links (Easiest)
<!-- Keep Stripe checkout elements on the same page as the AffiliateBase script. -->
<a href="https://buy.stripe.com/xxxxx">Buy now</a>
<stripe-pricing-table
pricing-table-id="prctbl_xxx"
publishable-key="pk_live_xxx"
></stripe-pricing-table>
<!-- For custom or redirected Stripe-hosted links, opt in explicitly. -->
<a data-affiliatebase href="https://link.payment/xxxxx">Buy now</a>
Stripe Checkout (Custom Integration)
// Server-side: use referral_id submitted from the browser checkout request.
// The browser value should be window.AffiliateBase.referral, not the public ?via token.
const referralId = req.body.referral_id || '';
const session = await stripe.checkout.sessions.create({
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
...(referralId && { client_reference_id: referralId }),
...(referralId && {
metadata: { affiliatebase_referral_id: referralId },
subscription_data: {
metadata: { affiliatebase_referral_id: referralId },
},
}),
line_items: [
{ price: 'price_xxx', quantity: 1 },
],
mode: 'subscription',
});
Test Your Integration
// Visit your site with a test affiliate link:
// Use the exact test affiliate link generated by AffiliateBase setup.
// Check the console to verify the referral ID is captured:
console.log(window.AffiliateBase?.referral); // Should show a generated referral ID
// Make a test purchase and verify in your AffiliateBase dashboard
Why Use AffiliateBase for Stripe Tracking?
Use one workflow to connect checkout attribution, recurring commissions, and payout preparation.
Connect Stripe
Authorize the Stripe connection in setup and confirm that payment events are arriving.
Server-Side Tracking
Process Stripe payment events on the server. Link attribution still depends on referral capture and a successful checkout handoff.
Subscription Lifecycle Tracking
Review attributed subscription payments and recurring commissions. Commission rules and recurring caps determine whether each payment earns a commission.
Real-Time Processing
Review processed Stripe events alongside the resulting sale and commission records.
Payment Links Support
Works seamlessly with Stripe Payment Links, Buy Buttons, and Pricing Tables.
One-Time and Recurring Payments
Attribute supported Stripe payment and invoice events to referrals. Test your actual billing flow, including renewals and refunds.
Frequently Asked Questions
How does Stripe affiliate tracking work?
Do I need to manually configure webhooks?
Does it work with Stripe Payment Links?
How are subscription renewals tracked?
What happens when a customer upgrades or downgrades?
Is server-side tracking more reliable than client-side?
What tracking parameters does AffiliateBase support?
Related Platform Guides
Add an Affiliate Program to Next.js
Install affiliate tracking in Next.js, hand the generated referral ID to a server-created Stripe Checkout Session, and verify attribution.
Add an Affiliate Program to Nuxt
Load affiliate tracking in Nuxt, pass the generated referral ID to a server route, and verify a Stripe sale and commission.
Create an Affiliate Program with WordPress
Install AffiliateBase on WordPress, choose a supported Stripe checkout, and verify referral attribution without assuming WooCommerce or plugin compatibility.
Create an Affiliate Program with Webflow
Add affiliate tracking to a published Webflow site, pair it with a supported Stripe checkout, and verify referral attribution before launch.
Add Affiliate Tracking to a React Checkout
Capture affiliate referrals in a React app, send the generated referral ID to your checkout backend, and verify Stripe attribution.
Ready to Set Up Stripe Affiliate Tracking?
Get started with AffiliateBase today and start tracking Stripe conversions accurately with server-side webhooks.