Add a referral program to Squarespace
Paste the widget script on the Squarespace page with your form and visitors can enter a referral code.
Before you start
Create a free Monkey Referrals account and a referral program. The dashboard shows your exact script with your real business ID and embed code ID. The examples below use placeholders.
Add the widget script
Squarespace only allows custom code on plans that include Code Blocks or Code Injection. Check that your plan supports it.
Option 1: Page header code injection
- Open Pages and hover over the page that holds your form.
- Open the page settings (the gear icon), then Advanced.
- Paste the widget script into Page Header Code Injection and save.
<script
src="https://cdn.monkeyreferrals.com/widget/v1/mr.js"
data-business="YOUR_BUSINESS_ID"
data-embed_code="YOUR_EMBED_CODE_ID"
></script>
Option 2: Code Block
- Edit the page and add a Code block below your form.
- Paste the widget script, turn off Display Source, and save.
Add the confirmation snippet
Paste this on the thank-you or confirmation page shown after the form is submitted. It confirms the referral and credits the promoter.
<script>
window.mr && window.mr('confirm');
</script>
If you cannot edit that page, skip this step and approve referrals manually from your dashboard.
Troubleshooting
- The referral field does not appear. Make sure the script is on the same page as the form and check the browser console for errors. Add
data-formwith a selector for your form, for exampledata-form="#signup-form". - The form loads late. Some builders load forms dynamically. The widget waits for the form, but a
data-formselector helps it find the right one. - Referrals stay pending. Add the confirmation snippet to your thank-you page, or approve them manually.
Questions? See the FAQ or contact us.
Ready to add your referral code field?
Free plan: one active program and unlimited successful referrals. Upgrade only if you need more.