Skip to main content
Astro is a good fit for AgentRef because the tracking script can live in one shared layout and still cover static pages, islands, and Stripe embeds.

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.
Put the script in the shared layout you use across public pages.
You do not need a separate Framer-style helper script in Astro. AgentRef already watches the DOM for late-rendered Stripe links, Buy Buttons, and Pricing Tables.

Checkout compatibility in Astro

  • 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.co for script-src and connect-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.

Stripe Checkout

Metadata bridge for custom Stripe sessions.

JavaScript Snippet

Full tracking-script reference.

Debug Mode

Inspect hosted Stripe instrumentation and warnings.