Before you start
- Set the program website in AgentRef to the same root domain your Astro site uses.
- Copy the exact script snippet from
Settings -> Integration. - If checkout starts on a sibling subdomain, install the script there too.
Recommended installation
Put the script in the shared layout you use across public pages.Checkout compatibility in Astro
Multi-domain and consent notes
- Shared subdomains on one root can work well if AgentRef is installed everywhere the journey can begin.
- If you use a consent banner script, call
window.AgentRef.setConsent('granted')after opt-in. - If you run a strict CSP, allow
https://www.agentref.coforscript-srcandconnect-src.
Verify the installation
1
Publish a real page with the script
Make sure the layout change is on the deployed site, not just in local preview.
2
Run a referral visit
Use a real affiliate link and confirm the AgentRef cookies appear.
3
Run debug mode
Add
?agentref_debug=1 and inspect the console output.4
Confirm diagnostics in AgentRef
Use the tracking health panel or
verify_tracking.Troubleshooting
- The script exists in the layout but cookies never appear: check whether the program website in AgentRef matches the live domain.
- Clicks arrive but Stripe conversions do not: your checkout backend still needs the Stripe guide.
- The script works locally but not in production: verify the deployed layout actually includes the script and that no CSP blocks it.
Related docs
Stripe Checkout
Metadata bridge for custom Stripe sessions.
JavaScript Snippet
Full tracking-script reference.
Debug Mode
Inspect hosted Stripe instrumentation and warnings.