Before you start
- Set the program website in AgentRef to the same root domain your Nuxt app uses.
- Copy the exact script snippet from
Settings -> Integration. - If checkout starts on another subdomain, install AgentRef there too.
Recommended installation
- nuxt.config.ts
- useHead fallback
The cleanest Nuxt installation is a global head script in
nuxt.config.ts.Checkout compatibility in Nuxt
| Checkout pattern | Recommendation |
|---|---|
| Hosted Stripe surfaces on Nuxt pages | Supported directly. |
| Nuxt server routes or backend create Checkout Sessions | Supported, but you must bridge window.AgentRef.getCheckoutMetadata() into Stripe metadata. |
| Cross-root-domain checkout | Not automatic. First-party cookies stay on one root domain. |
Nuxt-specific notes
- Install once globally instead of per page.
- AgentRef works well with route changes because the script remains loaded after hydration.
- If you enable consent mode, call
window.AgentRef.setConsent('granted')from your banner integration after opt-in.
Verify the installation
- Visit the Nuxt app through a live affiliate link.
- Confirm
agentref_cidandagentref_pidin browser cookies. - Add
?agentref_debug=1and inspect the console. - Complete one supported Stripe test checkout and confirm AgentRef records the conversion.
Troubleshooting
- The script only loads on one route: move it into
nuxt.config.tsor a shared app-level layout. - Clicks appear but no conversion does: your custom session path still needs the Stripe guide.
- Consent is required but cookies never appear: your banner integration probably never calls
window.AgentRef.setConsent('granted').
Related docs
Stripe Checkout
Required for custom session creation on the server.
Consent and GDPR
Gate tracking until the user accepts.
Debug Mode
Inspect runtime state and warnings.