Platform guide
Affiliate links on Next.js
AffyLink works on Next.js and other React stacks via a first-party script — keep destination URLs direct, inject keywords in content, and track clicks without a WordPress lock-in.
- Copy your AffyLink snippet (hash + tracker URL) from Settings.
- In the App Router, add
next/scripttoapp/layout.tsxwithstrategy="afterInteractive". - Pass
data-user-hashfrom your tracking hash; host the script from AffyLink or your own origin for first-party delivery. - Add your production hostname under Domains and verify installs from the AffyLink checklist.
import Script from 'next/script';
export default function RootLayout({ children }) {
return (
{children}
);
}