> ## Documentation Index
> Fetch the complete documentation index at: https://agentref.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Wix Integration

> Install AgentRef on a Wix site and understand the limits of Wix-native ecommerce checkout with AgentRef.

Wix works well for AgentRef as a marketing site or a page that hosts supported Stripe elements. Like several builders, it becomes a different conversation once Wix owns the actual checkout path.

## Before you start

* Set the program website in AgentRef to the same root domain your Wix site uses.
* Copy the exact script snippet from `Settings -> Integration`.
* If your app or checkout starts on another subdomain, install AgentRef there too.

## Install the script through Wix custom code

1. Open the Wix Editor for your site.
2. Go to `Settings -> Custom Code`.
3. Click `Add Custom Code`.
4. Choose `All Pages`.
5. Choose placement in `Head`.
6. Paste the AgentRef script:

```html theme={null}
<script
  defer
  src="https://www.agentref.co/api/tracking/script.js?pid=YOUR_PROGRAM_ID"
></script>
```

7. Apply the change and publish the site.

<Note>
  Wix custom code runs on the published site, not in editor preview.
</Note>

## Checkout compatibility on Wix

| Flow                                                              | Status with AgentRef                                         |
| ----------------------------------------------------------------- | ------------------------------------------------------------ |
| Stripe Payment Links, Buy Buttons, or Pricing Tables on Wix pages | Supported directly.                                          |
| Custom Stripe checkout outside Wix Stores                         | Supported with the [Stripe guide](/docs/integration/stripe). |
| Wix Stores or another Wix-native ecommerce checkout               | Not an automatic AgentRef attribution surface today.         |

## Multi-domain and consent notes

* Shared subdomains under one root work best when AgentRef is installed on both sides of the journey.
* Different root domains cannot share first-party cookies automatically.
* If you use a cookie banner, call `window.AgentRef.setConsent('granted')` after opt-in.

## Verify the installation

1. Publish the site.
2. Visit the live Wix domain through a real affiliate link.
3. Confirm `agentref_cid` and `agentref_pid` in browser cookies.
4. Add `?agentref_debug=1` and inspect the console.
5. If you use custom Stripe checkout, verify the [Stripe guide](/docs/integration/stripe) path too.

## Troubleshooting

* The code is saved in Wix but not live: publish the site again after the change.
* Clicks appear but no conversion does: you are likely in a Wix-native checkout path or missing the Stripe metadata bridge.
* Cookies disappear between marketing site and app: install AgentRef on both subdomains and keep them on one root domain.

## Related docs

<CardGroup cols={3}>
  <Card title="Stripe Checkout" icon="credit-card" href="/docs/integration/stripe">
    Required for custom Wix-to-Stripe flows.
  </Card>

  <Card title="Server-Side Tracking" icon="server" href="/docs/tracking/server-side">
    Fallback when the platform-owned checkout cannot pass AgentRef automatically.
  </Card>

  <Card title="Consent and GDPR" icon="shield" href="/docs/tracking/consent-gdpr">
    Coordinate AgentRef with your privacy banner.
  </Card>
</CardGroup>
