Skip to main content
AgentRef only needs one tracking script, but the correct installation point depends on your stack. This section gives you a platform-specific guide for each framework and builder linked from the AgentRef dashboard.

The AgentRef contract in one minute

  1. Install the script on every page where affiliate traffic can land or where checkout can start.
  2. Set the program website in AgentRef to the same root domain that serves the script.
  3. Keep the user journey on the same root domain when possible. www.example.com and app.example.com work well together. Different roots like example.com and example-store.com do not share first-party cookies.
  4. If you use Stripe Payment Links, Buy Buttons, or Pricing Tables on the same page, the script is usually enough.
  5. If you create Stripe Checkout Sessions yourself, read window.AgentRef.getCheckoutMetadata() and pass it into Stripe metadata. See the Stripe guide below.
  6. If a platform uses its own native ecommerce checkout, do not assume automatic attribution. Several builder guides call this out explicitly.
Copy the exact script snippet from Settings -> Integration in AgentRef. It already includes your real program ID.

Framework guides

Next.js

App Router and Pages Router installation for full-site tracking.

React

Install once in your app shell without duplicate script injection.

Vue.js

Recommended setup for Vue SPAs and static Vue sites.

Nuxt

Add AgentRef through nuxt.config.ts or a shared layout.

Astro

Install in a reusable Astro layout that covers all landing pages.

Svelte

SvelteKit and plain Svelte installation options.

Website builder guides

WordPress

Theme, plugin, and child-theme options for site-wide tracking.

Shopify

Theme installation plus a clear note about Shopify native checkout limits.

Webflow

Site-wide custom code setup for published Webflow sites.

Framer

Framer custom-code setup without extra helper scripts.

Wix

Add the script through Wix custom code on all published pages.

Squarespace

Use code injection for a global AgentRef install.

Stripe guide

Stripe Checkout Integration

Covers hosted Stripe surfaces, custom Checkout Sessions, metadata, and verification.

Verify any installation

1

Open a real affiliate link

Use a live test link from AgentRef so the visitor arrives with a real referral parameter like ?ref=abc123.
2

Confirm the cookies exist

In browser DevTools, check that agentref_cid and agentref_pid exist after the page loads.
3

Run a debug pass

Add ?agentref_debug=1 to the URL and inspect the browser console. You can also use ?agentref_verify=1 on a live page to trigger a tracking-install verification hit.
4

Check AgentRef diagnostics

Use the tracking health panel, the REST endpoint at /api/v1/programs/:id/tracking/status, or the MCP verify_tracking tool to confirm that the script install was seen and clicks are arriving.

JavaScript Snippet

Core script behavior, cookies, parameters, and the DOM API.

Consent and GDPR

How to gate AgentRef until the visitor grants consent.

Debug Mode

Inspect runtime state, warnings, and hosted Stripe instrumentation.