> ## 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.

# Squarespace Integration

> Install AgentRef with Squarespace code injection and understand where Squarespace-native checkout does or does not map to AgentRef automatically.

Squarespace is a good AgentRef fit for marketing pages and hosted Stripe surfaces. As with other website builders, the important distinction is whether Squarespace only renders the page or also owns the checkout.

## Before you start

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

## Install the script with code injection

1. Open your Squarespace site dashboard.
2. Go to `Settings -> Developer Tools -> Code Injection`.
3. Paste the AgentRef script into the `Header` field.

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

4. Save the change.

<Note>
  Squarespace code injection is typically available on Business plans and higher.
</Note>

## Checkout compatibility on Squarespace

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

## Multi-domain and consent notes

* Shared subdomains under one root can work well if AgentRef is installed on every surface that starts the journey.
* Different root domains do not share first-party cookies automatically.
* If you use a consent banner, call `window.AgentRef.setConsent('granted')` after opt-in.

## Verify the installation

<Steps>
  <Step title="Open a live referral visit">
    Use a real affiliate link on the published Squarespace domain.
  </Step>

  <Step title="Confirm cookies">
    Check for `agentref_cid` and `agentref_pid` in DevTools.
  </Step>

  <Step title="Use debug mode">
    Add `?agentref_debug=1` and inspect the console.
  </Step>

  <Step title="Validate your checkout path">
    If you use anything beyond hosted Stripe surfaces, follow the [Stripe guide](/docs/integration/stripe).
  </Step>
</Steps>

## Troubleshooting

* The script is saved but cookies never appear: confirm the published domain matches the website configured in AgentRef.
* Clicks exist but conversions do not: Squarespace Commerce native checkout is not an automatic AgentRef conversion path.
* The flow crosses into another domain: first-party cookies will not move across root domains without a deliberate handoff.

## Related docs

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

  <Card title="How Tracking Works" icon="magnifying-glass" href="/docs/tracking/how-tracking-works">
    Understand the full click-to-conversion pipeline.
  </Card>

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