Showing

How do I set up affiliate tracking with Stripe?

Add your LinkJolt webhook endpoint in Stripe and save the signing secret, then add the tracking script and pass the referral to your checkout. LinkJolt then records each Stripe sale and attributes it to the referring affiliate.

2 min read
Updated Sep 5, 2026

Connecting Stripe takes a few minutes and uses a per merchant webhook, so your sales are recorded against your account only.

Add the webhook

In your Stripe dashboard, add a webhook endpoint pointing at your unique LinkJolt URL:

https://www.linkjolt.io/api/webhooks/stripe/merchant/YOUR_MERCHANT_ID

Then tick the events it should send. checkout.session.completed is required. Add invoice.payment_succeeded, customer.subscription.updated and customer.subscription.deleted so renewals are tracked, and charge.refunded so a refund reverses the commission. Your dashboard lists the events beside your webhook URL.

After you create the endpoint, Stripe shows a Signing Secret starting with whsec_. Copy it and save it in LinkJolt under Settings, on the Payment Providers tab. Until you do, LinkJolt rejects every delivery to that endpoint and no sale is recorded. Stripe also keeps separate webhook lists for live and test mode, so add the endpoint in Live mode.

Add the tracking script

Put the LinkJolt tracking script in the head of every page a visitor can land on or buy from. It stores the affiliate details from the link click and exposes them as window.linkjolt.referral.

Tracking script (add before </head>)
<script src="https://www.linkjolt.io/api/tracking.js?id=YOUR_MERCHANT_ID"></script>

Pass the referral to checkout

If your buy link points at a Stripe Payment Link, the script appends the referral to it for you. Any checkout you build in code needs one line: pass window.linkjolt?.referral || '' as clientReferenceId in stripe.redirectToCheckout, or as client_reference_id on stripe.checkout.sessions.create if your server creates the session. Without it the click is recorded but the sale is never attributed.

Prefer not to touch checkout code? Register a discount code for each affiliate on the Coupons tab of the Campaigns page, and LinkJolt matches the orders that use it.

Your exact webhook URL, the event list and your tracking snippet all live under Integrations in your LinkJolt dashboard, on the page headed Integration Hub. For a full walkthrough, see the Stripe integration guide.

Start your affiliate program

Launch in minutes with 0% platform fees. 7-day free trial, cancel anytime.