Website integration is what makes FirstPromoter actually work. Without it, FirstPromoter cannot tell which affiliate sent a visitor, whether that visitor signed up, or whether they made a purchase. The full integration has three parts:Documentation Index
Fetch the complete documentation index at: https://docs.firstpromoter.com/llms.txt
Use this file to discover all available pages before exploring further.
| Part | What it does | Required? |
|---|---|---|
| Click tracking | Detects when a visitor arrives through an affiliate link | Yes |
| Referral tracking | Records who signed up or filled a form | Yes |
| Sales tracking | Attributes purchases to the right affiliate | Yes (to generate commissions) |
Before you start, find your Account ID in your FirstPromoter dashboard under Settings → Integrations. You’ll need it in the steps below.
Step 1 — Choose your integration path
Pick the option that matches your website setup:WordPress
Use our WordPress plugin for click tracking, referral tracking, and WooCommerce / MemberPress sales — no custom code needed.
Platform (no-code)
Using Kajabi, HighLevel, ClickFunnels, Ghost, Thinkific, SamCart, or similar? We have ready-made guides for each.
Custom website / app
Any other website, SaaS app, or JavaScript framework. Requires adding a script tag and one function call.
Platform integrations
If you use one of the platforms below, follow the dedicated guide — it handles click and referral tracking for that platform’s specific forms and checkout flows.HighLevel
ClickFunnels
Kajabi
Ghost
Thinkific
SamCart
ThriveCart
Kartra
Calendly
Dropfunnels
KickPages
Chargebee (hosted pages)
Custom website or app
Step 2a — Add the click tracking script
Add the following snippet to the<head> section of every public-facing page on your website. Replace YOUR_ACCOUNT_ID with the Account ID from your FirstPromoter dashboard.
WordPress (without plugin)
WordPress (without plugin)
Add the script to your
header.php file before the closing </head> tag, or use a plugin like Insert Headers and Footers to paste it into the head section without editing theme files.React / Vue / Angular
React / Vue / Angular
Add the script tags to your
public/index.html file inside the <head> section.Next.js
Next.js
- Create
/public/fprmain.jsand paste thefpr("init", ...)andfpr("click")lines into it. - In
_document.tsx, load both/fprmain.jsandhttps://cdn.firstpromoter.com/fpr.jsinside the<Head>component.
Nuxt.js
Nuxt.js
Create
/public/fprmain.js with the init and click lines, then use the useHead composable on your marketing pages to load it alongside fpr.js.Google Tag Manager
Google Tag Manager
Follow the GTM integration guide to add the scripts through a custom HTML tag.
Step 2b — Add referral tracking
When a visitor signs up or submits a form, you need to send their email (or user ID) to FirstPromoter. This is what creates the referral record and links the sign-up to the affiliate. Call the following after the main script and after you have the user’s email — typically on your sign-up success callback or thank-you page:"actual_user@email.com" with the real email of the user who just signed up. You can also pass a uid (user ID from your database) instead of or in addition to the email:
The
fpr("referral", ...) call must run after the user has successfully signed up — not before. If you redirect immediately after the call, the request may be cancelled by the browser. In that case, place the script on the thank-you/confirmation page instead.- Simple HTML form — listen for the form submit event, read the email input value, and call
fpr("referral", {email: emailValue}). - React / Vue / Angular — call it inside the success callback of your registration API request.
- Thank-you page with email in the URL — read the email from the URL and pass it directly:
fpr("referral", {email: new URLSearchParams(location.search).get("email")}). - Server-side only — use the Tracking API to make the call from your backend instead.
Step 3 — Sales tracking
Sales tracking tells FirstPromoter which purchases to credit to which affiliate and triggers commission creation.Option A — Connect a billing provider (recommended)
If you use one of the following billing providers, connect it directly in FirstPromoter and sales are tracked automatically:Stripe
Chargebee
Paddle
Recurly
Braintree
Option B — Use the Tracking API
If you use a different billing provider or have a custom payment flow, send a sale event to FirstPromoter from your backend whenever a payment is confirmed:sale_amount is in cents (e.g. 4900 = $49.00).Step 4 — Test your integration
Before going live, verify each part is working:Test click tracking
Copy an affiliate’s referral link from the FirstPromoter dashboard and visit it in your browser. A click should appear on that affiliate’s record within a few seconds.
Test referral tracking
After visiting via the referral link, sign up as a test user on your website. Check the Referrals tab in FirstPromoter — a new lead should appear linked to the affiliate.
Need help?
- Full fpr.js script reference — every method and option explained
- Tracking without fpr.js (API only) — pure API approach with no frontend script
- Proxy setup — keep tracking working when ad-blockers are active
- Support — reach the team if you’re still stuck