Loading referral codes...
Click one of these links to simulate a user arriving via a referral:
The middleware will detect the ?ref= parameter, set a tracking cookie, record the visit, and redirect to the configured tenant URL (or clean URL if none set).
Loading...
This will create a test user and attribute them to the affiliate from the cookie:
After signup, the user will be linked to the affiliate. Check the dashboard to see the referral count increase.
No visits recorded yet. Click a referral link above!
1. Referral Link Click: User visits your site with ?ref=CODE
2. Middleware Detection: Next.js middleware detects the ref param
3. Cookie Set: HTTP-only cookie stored (30 days by default)
4. Visit Recorded: Visit logged with IP hash, user agent, landing page
5. User Signs Up: During registration, the attribution API is called
6. Attribution: User linked to affiliate, visit marked as converted
7. Payment: When user pays (Stripe webhook), commission is calculated
8. Payout: After lock period, commission becomes payable to affiliate