Install on Squarespace
Code Injection greater-than Header on the Business plan or higher. Squarespace Commerce runs on your own Stripe so attribution works automatically once the head script is in place.
Squarespace's install is one of the simplest among the no-code platforms: paste a script in the Code Injection header field and publish. The only friction is that Code Injection requires the Business plan or higher (the Personal plan does not expose it). If you're on Personal, upgrade first or the field will not appear in Settings.
Install the head script
Squarespace admin > Settings > Advanced > Code Injection > Header.
Paste:
<script>
(function(){
var s=document.createElement('script');
s.src='https://js.rekomi.com/v1/rekomi.js';
s.async=true;
s.dataset.programId='YOUR_PROGRAM_ID';
document.head.appendChild(s);
})();
</script>Click Save (top-left of the Code Injection panel). The script now loads on every public Squarespace page.
Your program ID is in Rekomi at Settings > Tracking.
Squarespace 7.0 vs 7.1
The path above is for Squarespace 7.1 (the current default for new sites). Legacy 7.0 sites have different admin chrome, but the same Settings > Advanced > Code Injection > Header path leads to the same field. The install is identical.
Squarespace Commerce uses your own Stripe
If your Squarespace site has the built-in Commerce module enabled, payments flow through your connected Stripe account (not Squarespace's). This means the standard Stripe Connect attribution rail applies: the head script captures clicks, and the Stripe webhook closes the loop when a buyer completes checkout. No additional Squarespace-specific step needed for Commerce orders.
To verify your Squarespace Commerce is connected to your Stripe: Squarespace admin > Commerce > Payments. You should see your Stripe account listed as the payment processor.
External Stripe Payment Links
If you're using Squarespace as a marketing site and embedding a Stripe Payment Link as a button (rather than using Squarespace Commerce), you also need to add the MutationObserver auto-stamping snippet so the Payment Link picks up the affiliate referral.
In Settings > Advanced > Code Injection > Header, paste this AFTER the install snippet:
<script>
(function(){
function stamp(node){
var links = node.querySelectorAll('a[href*="buy.stripe.com"]');
var ref = window.Rekomi && window.Rekomi.getReferral();
if (!ref) return;
links.forEach(function(a){
try {
var u = new URL(a.href);
if (!u.searchParams.get('client_reference_id')) {
u.searchParams.set('client_reference_id', ref);
a.href = u.toString();
}
} catch (e) {}
});
}
document.addEventListener('DOMContentLoaded', function(){ stamp(document); });
new MutationObserver(function(muts){
muts.forEach(function(m){ m.addedNodes.forEach(function(n){
if (n.nodeType === 1) stamp(n);
}); });
}).observe(document.body, { childList: true, subtree: true });
})();
</script>Without this observer, Payment Links embedded in Squarespace Code Blocks won't carry the affiliate slug into the Stripe checkout, and attribution will silently fail.
Quirks worth knowing
Business plan required. Personal-plan sites cannot install custom code. The Code Injection menu item simply isn't there. Upgrade or use a different platform.
Code Injection runs on every page. Header code injects into the global template, so it loads on every page Squarespace serves. No per-page configuration needed.
Sitewide Header vs per-page Code Injection. Squarespace also exposes a per-page Code Injection field on individual pages (Page settings > Advanced). Don't install Rekomi there — that would only run on that one page. Always use the Settings > Advanced > Code Injection > Header path for sitewide install.
Squarespace Stripe is real Stripe. Don't worry that Squarespace abstracts the integration — when a buyer pays, your Stripe account receives the charge and fires the webhook to Rekomi normally. The standard Stripe attribution rail works.
Custom Forms (non-Commerce) submissions. If you collect leads via Squarespace's native Form Block (not the Commerce checkout), the lead doesn't go through Stripe and doesn't fire a Stripe webhook. To attribute lead-magnet style affiliate programs, fire a manual convert event from the form's confirmation page using the head script's window.Rekomi.convert() call.
Troubleshooting
Code Injection menu item is missing. You're on the Personal plan. Upgrade to Business or higher.
Script appears in Code Injection but not in View Source on the live site. Hard-refresh the page (Cmd+Shift+R). Squarespace serves CDN-cached HTML by default; the script may take a few minutes to appear after Save.
Squarespace Commerce orders don't attribute. Confirm your Stripe account is connected at Commerce > Payments and that the Rekomi Stripe webhook listener (Settings > Tracking > Stripe webhook in Rekomi) shows recent events from that Stripe account.
Payment Link in a Code Block doesn't carry the affiliate slug. You didn't add the MutationObserver snippet. Add it as a second <script> block in Header Code Injection.
Related
- JavaScript pixel reference
- Install on Stripe — for the Stripe Commerce and Payment Links attribution patterns
- Squarespace docs: Code Injection
Install on Framer
The head slot lives behind "Show Advanced" in Site settings and many brands miss it. Publish is explicit. Free plan cannot ship custom code.
Install on Wix
Dashboard Custom Code (not the Editor) with Head placement. Paid plan required. Skip Velo HTML iframes, they run in a sandbox that cannot read window.Rekomi.