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

  1. Install @affitor/sdk and wrap your app in AffitorProvider with your program ID.
  2. After a user signs up, call trackLead from your server with their user ID and the affitor_click_id cookie.
  3. Connect Stripe and add Affitor metadata to the Checkout Session, or send each sale from your server with trackSale.

Read the full guide: Next.js guide

More integrations