Next.js
Tracks clicks, signups and sales in a Next.js App Router app with @affitor/sdk.
What it does
- The tracker reads
?aff=from the URL and stores the click in a first-party cookie. - Your server links each signup to that click, with your own user ID.
- Sales come from Stripe, or from your server with any payment provider.
Set up in three steps
- Install
@affitor/sdkand wrap your app inAffitorProviderwith your program ID. - After a user signs up, call
trackLeadfrom your server with their user ID and theaffitor_click_idcookie. - Connect Stripe and add Affitor metadata to the Checkout Session, or send each sale from your server with
trackSale.