# Affiliate Link Tracking: Affiliate link infrastructure, built for Stripe

Affiliate links are built for however you sell with Stripe: first-class support for both recurring and one-time commission tracking.

## Highlights

- **Attribution from Stripe itself.** Referrals are tied to real Stripe customers and payments, so commissions follow renewals, upgrades and refunds.
- **Works with how you sell.** Stripe Checkout, subscriptions created through the API, Payment Links, Buy Buttons and the embeddable pricing table.
- **60-day cookie by default.** Change the referral window per campaign to match your sales cycle.

## How it works

1. **An affiliate shares their link.** For example yoursite.com?via=maya.
2. **The visitor lands on your site.** The PromoteKit script stores the referral in a cookie.
3. **They pay through Stripe.** The referral is passed to Stripe with the checkout, or picked up automatically for Payment Links and pricing tables.
4. **The sale is credited.** PromoteKit attributes the payment and calculates the commission.

## What's included

- **One script.** Add the PromoteKit script to your site's head or body. There's also a dedicated Webflow app.
- **Stripe API.** Pass window.promotekit_referral as promotekit_referral in the metadata of the Checkout Session or subscription you already create.
- **Track sign-ups before payment.** Call window.promotekit.refer(email, stripe_customer_id) when someone signs up, so free trials and freemium users are credited before they pay.
- **Clicks and conversions.** See clicks, sign-ups and paying customers per affiliate in your dashboard. Affiliates see their own numbers in the portal.

## FAQ

### Do I need a developer?

For Payment Links, Buy Buttons and pricing tables, you only need to paste a script tag. For custom checkouts, a developer adds one metadata field to your Stripe API call. If you'd rather not touch your site, use coupon code tracking instead.

### How long does the referral cookie last?

60 days by default. You can change it per campaign.

### Does it work with subscriptions?

Yes. Affiliates can earn on every renewal, for as long as your campaign's commission settings allow.

### Can I use links and coupon codes together?

Yes. A campaign can track links, codes, or both.

## Links

- Read the link tracking guide: https://www.promotekit.com/docs/affiliate-links
- Pricing: https://www.promotekit.com/pricing.md
- Sign up free: https://www.promotekit.com/auth/sign-up
