Troubleshooting tracking
Install the passive SDK, verify the consent lifecycle, and fix common tracking problems.
RefCampaign tracks visits through a browser SDK on your site. This page covers the install, the verification, and what to check when tracking doesn't work. You'll find it under Settings → SDK setup.
Install and verify
- 1
Install the SDK
Pick your platform (Next.js App Router, Next.js Pages Router, no-code script tag, or custom JavaScript) and add the snippet to your site.
- 2
Connect your consent manager
Keep the passive SDK loaded on every page, then connect your CMP to
setConsent. It must forward an initial grant, an initial refusal, the persisted choice after reload, and any later withdrawal. - 3
Confirm the four consent scenarios
Test each scenario on your merchant site, then check it in the authenticated RefCampaign setup. Refusal must create no attribution session; withdrawal must delete the existing session. Completing all four confirmations establishes trusted consent capability.
- 4
Run site diagnostics
Use Check site configuration after the consent checklist. The public script detection and install heartbeat are advisory diagnostics; they do not establish trusted readiness by themselves.
Readable and direct referral links are enabled only after the authenticated consent checklist is complete and the referral alias has synchronized. Until then, RefCampaign keeps the opaque redirect link as the safe fallback.
When tracking doesn't work
Run Check site configuration to scan the page. Common findings:
- SDK missing from public HTML — the snippet isn't deployed on the page you tested. Confirm it ships in production.
- CSP blocks the SDK — your Content Security Policy rejects the script. Add the RefCampaign source to your
script-srcdirective. - CSP blocks capture — the SDK loads but can't send data. Add the source to your
connect-srcdirective.
Attribute conversions
Consented visit tracking creates the attribution session, but it cannot connect a purchase or sign-up to the right affiliate on its own. The second step, Attribute conversions, is required. Choose one method:
- With Stripe — pass the RefCampaign session in Stripe metadata. Connect Stripe first (see connecting Stripe), then select the payment flow used by your backend.
- From your backend — send each conversion with
RefCampaignServerfor a JavaScript or TypeScript stack, or use the server-to-server postback in another runtime.
Confirm the integration after implementing it. The first real conversion then confirms end-to-end tracking.