Background
⌘K

Squarespace Integration

Learn how to integrate Affonso affiliate tracking into your Squarespace website.

Silvestro
Written by Silvestro
Updated more than a month ago

Squarespace's built-in code injection feature makes it simple to add tracking scripts across your entire website, ideal for SaaS companies using Squarespace for their marketing presence.

Add tracking script to your Squarespace site

Squarespace's recommended approach is to use the site-wide code injection settings, which applies the script to every page automatically.

  1. Open your Squarespace site dashboard

  2. Go to Settings → Developer Tools → Code Injection

  3. In the Header section, add your tracking script:

    <script
      async
      defer
      src="https://affonso.io/js/pixel.min.js"
      data-affonso="YOUR_PUBLIC_PROGRAM_ID"
      data-cookie_duration="YOUR_COOKIE_DURATION"
    ></script>
  4. Click Save

  5. The script will automatically appear on all pages

Alternative: Use page-specific code injection by going to Pages → [Specific Page] → Settings → Advanced → Page Header Code Injection for targeted tracking.

For more details, see Squarespace's official code injection guide.

Find your Program ID →

Testing

  1. Visit your Squarespace site with ?atp=test
  2. Check browser DevTools → Console → type window.affonso_referral
  3. Verify the script appears in your page source
  4. Check tracking in your Affonso dashboard

Note: Code injection is available on Business plans and higher.

Multi-Domain Setup

If you're using Squarespace only for your marketing site (e.g., yourcompany.com) and your SaaS app runs on a subdomain (e.g., app.yourcompany.com), make sure to install the Affonso tracking script on both domains.

Affonso works seamlessly across subdomains - the same affiliate cookie will be shared between yourcompany.com and app.yourcompany.com. See our multi-domain setup guide for more details on cross-domain tracking.

Next Steps

Once installed, you can access affiliate referral data and pass it to your payment provider. Connect your payment provider →

Was this article helpful?

If you still need help, our support team is here for you.

Contact Support
bg

Ready to Scale Your SaaS?

Affonso is the easiest way to launch your own affiliate program. We take care of the technical stuff, so you can focus on growing your business.