Skip to main content

How to Create an Affiliate Program with Squarespace

Know what must work before you launch

Use code injection for the landing page and prove the checkout separately

Best fit
Teams evaluating AffiliateBase for a Squarespace affiliate workflow.
Checkout handoff
The checkout path must receive the generated AffiliateBase referral ID.
Proof required
Complete one referred checkout and confirm the attributed sale and commission.

Follow the attribution evidence

Illustrative scenario · fictional values

  1. Referred visit

    ?via=partner

    AffiliateBase captures the visit and generates a referral record.

  2. Checkout handoff

    referral ID

    The checkout must carry the generated identifier into Stripe.

  3. Paid event

    $99 paid

    A supported Stripe event confirms the attributed payment.

  4. Commission

    $19.80 due

    An eligible attributed sale creates the commission record.

  5. Payout prep

    Payout ready

    Review the commission and prepare the next step with your payout provider.

This guide is for Squarespace merchants running an affiliate program for their own offers. It is not an application guide for Squarespace’s company affiliate program.

You need a Squarespace plan and permissions that allow code injection, plus a published page where the tracking script runs. Code on a sales page does not establish access to Squarespace Commerce checkout.

Treat native Squarespace checkout as unverified. A supported path uses a Stripe Payment Link or Buy Button on the same tracked page, followed by the AffiliateBase checkout verification.

Follow these steps to integrate AffiliateBase with your Squarespace site:

1

Add the Tracking Script

Add the AffiliateBase tracking script to your Squarespace site. Navigate to **Settings > Advanced > Code Injection** and paste this script in the **Header** section. Use the pinned jsDelivr tracking URL for the latest published AffiliateBase release.
html
<script async src="https://app.affiliatebase.io/track.js" data-account-id="YOUR_ACCOUNT_ID"></script>
2

Use Stripe Payment Links or Buttons (Optional)

If you're using Stripe Payment Links or Buy Buttons on your Squarespace site, add the tracking script on the same page so AffiliateBase can pass the generated referral ID.
html
<!-- Keep Stripe checkout elements on the same page as the AffiliateBase script. -->
<a href="https://buy.stripe.com/xxxxx">Buy now</a>

<stripe-pricing-table
  pricing-table-id="prctbl_xxx"
  publishable-key="pk_live_xxx"
></stripe-pricing-table>

<!-- For custom or redirected Stripe-hosted links, opt in explicitly. -->
<a data-affiliatebase href="https://link.payment/xxxxx">Buy now</a>
3

Track Form Submissions (Optional)

Add data-affiliatebase="true" to forms to auto-inject the referral ID. Add this script to **Code Injection > Footer** to track form submissions.
html
<!-- Add to Code Injection > Footer -->
<script>
  document.addEventListener('DOMContentLoaded', function() {
    // Auto-inject referral ID into Squarespace forms
    const forms = document.querySelectorAll('form[data-form-id]');
    forms.forEach(form => {
      const referralId = window.AffiliateBase?.referral || '';
      if (referralId) {
        const hiddenInput = document.createElement('input');
        hiddenInput.type = 'hidden';
        hiddenInput.name = 'affiliatebase_referral';
        hiddenInput.value = referralId;
        form.appendChild(hiddenInput);
      }
    });
  });
</script>
4

Test Your Integration

Visit your Squarespace site with a test affiliate link and verify tracking is working.
javascript
// Visit your site with a test affiliate link:
// Open the exact setup-test link shown in AffiliateBase.

// Open browser console and check:
console.log(window.AffiliateBase?.referral); // Should show a generated referral ID

Why Use AffiliateBase with Squarespace?

Squarespace can host the landing-page script; the payment path still needs a separate compatibility test.

No-Code Integration

Add affiliate tracking using Squarespace's code injection feature without complex development.

Form Integration

Track conversions from Squarespace forms, including contact forms and newsletter sign-ups.

Stripe Integration

Use a Stripe Payment Link or Buy Button on the same tracked page, then verify the completed checkout carries the generated referral ID.

Easy Setup

Simple code injection setup that works with any Squarespace template.

Frequently Asked Questions

Do I need to know how to code to use AffiliateBase with Squarespace?
You need a plan and permissions that support code injection. After publishing, confirm the script loads and does not conflict with consent settings.
Can I track conversions from Squarespace forms?
Yes! You can add a script to automatically inject the referral ID into form submissions.
Does AffiliateBase work with Stripe on Squarespace?
Payment Links and Buy Buttons are the path to test on a tracked Squarespace page. Native Squarespace Commerce checkout is not established here.
What tracking parameters does AffiliateBase support?
AffiliateBase automatically detects ?via= URL parameters by default. You can add custom token keys with data-affiliatebase-params.

Related Platform Guides

Ready to Launch Your Squarespace Affiliate Program?

Get started with AffiliateBase today and start growing your Squarespace site with affiliate marketing.