Linkjolt
Sign InStart Free
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.

Start Free TrialView Setup Guide

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 or Paddle 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 or Paddle Webhooks

Add your LinkJolt webhook URL in your Stripe or Paddle dashboard. 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

What People Say About Us

Testimonials

Don't just take our word for it - hear from some of our satisfied customers!

"

Linkjolt made affiliate programs easy for us. Some of theother 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

Dagobert Renouf
Dagobert Renouf@dagorenouf

Marketing Specialist

Video from Itslaunchday

PRICING

Simple Pricing

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

No hidden fees

Cancel anytime

0% transaction fees

3.5 months free
Monthly
Annual
Save 30%
Starter
For Small Teams
$19.99/month

Up to $5,000/month earned from affiliates

0% Transaction Fees

What's included
  • 5 active campaigns

  • 50 affiliate invites per month

  • 10 active affiliates

  • Advanced analytics (3-month data retention)

  • Email support

  • Standard affiliate tracking

  • Fraud detection system

  • Stripe payout integration

  • Team members

  • Branded affiliate signup pages

  • Affiliate program discovery

  • Unlimited campaigns

  • Unlimited affiliate invites

  • Unlimited affiliates

  • Custom commission structures

  • Bulk payouts

  • Direct Affiliate/Team Chat

$0.00 due today

Get Started
MOST POPULAR
Professional
Most Popular
$39.99/month

Up to $25,000/month earned from affiliates

0% Transaction Fees

What's included
  • Unlimited active campaigns

  • Unlimited affiliates

  • Unlimited affiliate invites

  • Advanced analytics (12-month data retention)

  • Priority chat and email support

  • Advanced affiliate tracking

  • Enhanced fraud detection

  • Stripe payout integration

  • 2 team members

  • Custom commission structures

  • Branded affiliate signup pages

  • Auto-approve affiliates option

  • Bulk payouts

  • Affiliate program discovery

  • Automated payout management

  • Direct Affiliate/Team Chat

$0.00 due today

Try Pro
Ultimate
For Scale-Ups
$79.99/month

Up to $50,000/month earned from affiliates

0% Transaction Fees

What's included
  • Unlimited active campaigns

  • Unlimited affiliates

  • Unlimited affiliate invites

  • Advanced analytics (12-month data retention)

  • Priority chat and email support

  • Advanced affiliate tracking

  • Enhanced fraud detection

  • Stripe payout integration

  • 20 team members

  • Custom commission structures

  • Branded affiliate signup pages

  • Auto-approve affiliates option

  • Bulk payouts

  • Affiliate program discovery

  • Automated payout management

  • Direct Affiliate/Team Chat

$0.00 due today

Get Ultimate
Affiliates Join for Free

Affiliate registration is completely free! Your partners can sign up and start promoting your products without any subscription fees.

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.

Related Resources

Stripe Affiliate Tracking

Server-side tracking via Stripe webhooks for the most reliable attribution.

Learn more

Get Started

Ready to Add Affiliate Tracking to Next.js?

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

Start Free Trial

3-Day Free Trial

0% Platform Fees

Cancel Anytime

LIVE

0+

SaaS companies joined this week

LinkJolt

The all-in-one affiliate management platform for SaaS companies.

Product

© 2026 LinkJolt. All rights reserved.

GDPR Compliant Badge
LinkJolt SaaSHub BadgeUneed Product of the Day BadgeTinyLaunch Badge

Made with ♥ for SaaS companies