Next.js Integration

Next.js Affiliate Tracking

Add affiliate tracking to your Next.js app with the Script component and App Router. Server-side conversion tracking via Stripe or Paddle webhooks. Full TypeScript support, 0% transaction fees.

App Router ready

TypeScript support

0% transaction fees

How It Works

1.

Script component loads tracking

2.

Cookies store attribution for 30 days

3.

Customer completes checkout

4.

Stripe/Paddle webhook tracks the sale

Next.js Affiliate Tracking Features

Native support for App Router, Script component, and server-side webhook tracking

App Router Compatible

Full support for Next.js 13+ App Router. Works seamlessly with Server Components, Client Components, and Route Handlers.

Script Component Integration

Load the tracking script using the native Next.js Script component with strategy="afterInteractive". No hydration issues, no render blocking.

TypeScript Support

Fully typed tracking methods with TypeScript definitions. Autocomplete for all conversion events and tracking API calls.

Server-Side Tracking

Conversions are tracked server-side via Stripe, Paddle, Polar or Creem webhooks. No client-side conversion calls needed for the primary tracking method.

Real-Time Analytics

Track clicks, conversions, and revenue instantly. Affiliates get their own performance dashboard with detailed insights.

Fraud Prevention

Rule-based fraud detection with IP matching, email comparison, order deduplication, and configurable risk scoring.

Setup in 4 Steps

Add affiliate tracking to your Next.js app in about 5 minutes

1
Create LinkJolt Account

Sign up, create a campaign, and copy your Merchant ID from the Integration Hub.

2
Add Script Component to layout.tsx

Import the Next.js Script component and add the LinkJolt tracking script to your root layout with strategy="afterInteractive".

3
Connect Stripe, Paddle, Polar or Creem Webhooks

Add your LinkJolt webhook URL in your Stripe or Paddle dashboard, or connect Polar with one approval. Conversions are tracked automatically via server-side webhooks.

4
Invite Affiliates

Send invitations or create public signup links. Affiliates start promoting your Next.js app immediately.

Code Snippets to Copy

Step 2
Script Component in layout.tsx

Add to your root layout for automatic click tracking

// app/layout.tsx
import Script from 'next/script'

export default function RootLayout({
  children
}: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script
          src="https://www.linkjolt.io/api/tracking.js?id=YOUR_MERCHANT_ID"
          strategy="afterInteractive"
        />
      </body>
    </html>
  )
}
Replace YOUR_MERCHANT_ID with your actual Merchant ID from the LinkJolt Integration Hub.
Step 3
Stripe Checkout with Attribution

Pass affiliate attribution via client_reference_id

// Stripe Checkout with affiliate attribution
import Stripe from 'stripe'
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!)

const session = await stripe.checkout.sessions.create({
  line_items: [{ price: 'price_xxx', quantity: 1 }],
  mode: 'subscription',
  success_url: 'https://yourapp.com/success',
  cancel_url: 'https://yourapp.com/cancel',
  // LinkJolt tracking script sets this automatically
  // via window.linkjolt.referral
  client_reference_id: referralString,
})
The tracking script sets window.linkjolt.referral automatically. Pass it to your checkout API route for server-side attribution.

How LinkJolt Compares

FeatureLinkJoltManual SetupOther Platforms
Setup Time5 minutesHours/Days15-30 min
Transaction Fees0%N/A3-5%
App Router SupportNativeCustomVaries
Server-Side TrackingWebhooksCustom codeVaries
TypeScript SupportBuilt-inDIYSome
Recurring CommissionsAutomaticManualSome platforms
Fraud DetectionBuilt-inNoneExtra cost
TESTIMONIALS

What People Say About Us

Don’t just take our word for it. Hear from some of our satisfied customers!

β˜…β˜…β˜…β˜…β˜…
β€œLinkjolt made affiliate programs easy for us. Some of the other platforms were very difficult and clunky to use, but this UI is so simple and it just works. Highly recommend!”
Henry
Henry

Founder at multiple startups

β˜…β˜…β˜…β˜…β˜…
β€œWe've increased our conversion rates by 37% since we started using LinkJolt. The tracking features and instant payouts alone are worth the price! .”
Zeger Hoogeboom
Zeger Hoogeboom

Founder at Coreties.com

β˜…β˜…β˜…β˜…β˜…
β€œThe dashboard gives our team the insights we need to work more efficiently and help our partners earn more money. ”
Cleo
Cleo

Founder at Genebreak

β€œF!*@ I need that”
Dagobert Renouf
Dagobert Renouf

Marketing Specialist Β· @dagorenouf

β˜…β˜…β˜…β˜…β˜…

Video from Itslaunchday

β˜…β˜…β˜…β˜…β˜…
β€œI really appreciate how quick you are to respond and how willing to work with me you've been throughout our setup process.”
β˜…β˜…β˜…β˜…β˜…
β€œThis is f***ing awesome!! Haha sorry for the language but really happy with how you guys reply to everything and were able to implement changes so quickly and I really see that you're trying to make it as good possible for the people using it.”
β˜…β˜…β˜…β˜…β˜…
β€œThanks for your help, I'm glad everything is working as it should.”
PRICING

Simple Pricing

Choose the perfect plan for your business. Start with a 7-day free trial.

No hidden fees Cancel anytime 0% transaction fees
3.5 months free with annual billing
Find your fit.Let others sell your product for you.

Every plan starts with a
7-day free trial.

For small teams

Starter

$19.99 a month on monthly billing,$13.99
/month, billed annually
Try Starter Free$0.00 due today
Most popular

Professional

$39.99 a month on monthly billing,$27.99
/month, billed annually
Try Pro Free$0.00 due today
For scale-ups

Ultimate

$99 a month on monthly billing,$69
/month, billed annually
Try Ultimate Free$0.00 due today
Your program
Affiliate-driven sales / monthUp to $5,000Up to $50,000
Active campaigns5Unlimited
Active affiliates10Unlimited
Staff seats Not included20
Analytics data retention3 months12 months
Tracking & growth
Affiliate trackingStandardAdvanced
Fraud protectionStandardEnhanced
Stripe payout integration Included Included
Bulk payouts Included Included
Affiliate discovery Not included Included
Custom commission structures Not included Included
Developer API Not includedFull access
MCP Server Not includedFull access
Direct affiliate & staff chat Not included Included
Your brand & support
Branded affiliate signup pages Not included Included
Affiliate portal on your domain Not included Included
Remove the Linkjolt badge Not included Included
SupportEmailPriority Chat + Email
More automation with Professional & Ultimate

Auto-approve affiliates and automate payout management. Commission tiers: up to 5 on Professional, up to 10 on Ultimate.

Doing more than $50,000 a month in sales?

The Scale plan has unlimited tracked sales for a flat $249 a month on monthly billing, $199.20/mo, billed annually.

See the Scale plan

Want to earn commissions as an affiliate? Joining is free.

Frequently Asked Questions

Does LinkJolt work with the Next.js App Router?

Yes. LinkJolt fully supports Next.js 13+ App Router. Add the tracking script to your root layout.tsx using the Next.js Script component with strategy="afterInteractive". The script handles click tracking automatically via cookies and localStorage. No changes to your routing or page structure are needed.

Does it work with Server Components?

Yes. The LinkJolt tracking script is added to your root layout and runs client-side without causing hydration issues. It is fully compatible with React Server Components. Conversion tracking happens server-side through Stripe or Paddle webhooks, so no client component wrappers are required for tracking purchases.

How are conversions tracked?

Conversions are tracked server-side via Stripe or Paddle webhooks (recommended). When a customer clicks an affiliate link, the tracking script stores attribution in cookies. At checkout, the attribution data is passed to Stripe via client_reference_id. Stripe then sends a webhook to LinkJolt with the conversion details. No client-side conversion code is needed for this flow.

Does affiliate tracking affect Next.js performance?

No. The LinkJolt script loads asynchronously after the page is interactive using the Next.js Script component. It does not block rendering or affect Lighthouse scores. The script is lightweight, uses passive event listeners, and has zero impact on Core Web Vitals.

Can I use this with both Stripe and Paddle?

Yes. LinkJolt supports both Stripe and Paddle as payment processors. Add the tracking script to your layout.tsx for click attribution, then connect whichever payment processor you use. Webhook-based conversion tracking works with both providers out of the box.

Get Started

Ready to Add Affiliate Tracking to Next.js?

Start your 7-day free trial. Add the Script component to your layout.tsx in minutes. 0% transaction fees.

7-Day Free Trial

0% Platform Fees

Cancel Anytime

LIVE

πŸ‡ΊπŸ‡Έ

4

πŸ‡¬πŸ‡§

2

πŸ‡©πŸ‡ͺ

2

10+

SaaS companies joined this week