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
| Checkout pattern | Recommendation |
|---|---|
| Stripe Payment Links, Buy Buttons, or Pricing Tables embedded in Astro pages | Supported directly. |
| Custom server-created Stripe Checkout Session | Supported, but you must pass AgentRef metadata into Stripe on the server. |
| External checkout on another root domain | Not automatic. Keep checkout on the same root or build an intentional server-side handoff. |
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
Publish a real page with the script
Make sure the layout change is on the deployed site, not just in local preview.
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.