Squarespace is a popular all-in-one platform for building beautiful websites, online stores, and portfolios. If you're running a Squarespace site and want to monetize it through an affiliate program, AffiliateBase makes it simple.
This comprehensive guide will walk you through everything you need to know about setting up an affiliate program with Squarespace, from code injection to form tracking and Stripe payment integration.
Whether you're running a blog, online store, or portfolio site, an affiliate program can help you grow your audience and increase revenue.
Follow these steps to integrate AffiliateBase with your Squarespace site:
Add the Tracking Script
<script>(function(w,r){w._abq=w._abq||[];w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)}})(window,'affiliatebase');</script>
<script async src="https://cdn.jsdelivr.net/npm/affiliatebase-tracking@1/src/index.js" data-org-id='YOUR_ORG_ID'></script>
Add Stripe Payment Links Support (Optional)
<!-- Add to your site alongside the tracking script -->
<script>
document.addEventListener('DOMContentLoaded', function() {
setTimeout(function() {
const referralId = window.affiliatebase_referral || '';
if (!referralId) return;
// Update Stripe Payment Links
document.querySelectorAll('a[href^="https://buy.stripe.com/"]').forEach(link => {
const url = new URL(link.href);
if (!url.searchParams.has('client_reference_id')) {
url.searchParams.set('client_reference_id', referralId);
link.href = url.toString();
}
});
// Update Stripe Pricing Tables
document.querySelectorAll('stripe-pricing-table').forEach(table => {
table.setAttribute('client-reference-id', referralId);
});
// Update Stripe Buy Buttons
document.querySelectorAll('stripe-buy-button').forEach(button => {
button.setAttribute('client-reference-id', referralId);
});
}, 1500);
});
</script>
Track Form Submissions (Optional)
<!-- 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>
Test Your Integration
// Visit your site with a test affiliate link:
// https://yoursite.squarespace.com?via=test123
// Open browser console and check:
console.log(window.affiliatebase_referral); // Should show "test123"
Why Use AffiliateBase with Squarespace?
AffiliateBase is the perfect solution for Squarespace users who want to add affiliate marketing without leaving the platform.
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
Works seamlessly with Stripe Payment Links, Buy Buttons, and embedded checkout.
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?
Can I track conversions from Squarespace forms?
Does AffiliateBase work with Stripe on Squarespace?
What tracking parameters does AffiliateBase support?
Related Platform Guides
Create an Affiliate Program with Webflow
Complete guide to setting up an affiliate program in Webflow. Step-by-step integration with Webflow CMS, custom code, and forms for no-code developers.
Create an Affiliate Program for Your Wix Site
Complete guide to setting up an affiliate program for your Wix site. Step-by-step integration with Wix custom code, forms, and Wix Stores for website owners.
Create an Affiliate Program with Next.js
Complete guide to setting up an affiliate program in Next.js. Step-by-step integration with code examples and best practices for Next.js developers.
Create an Affiliate Program with Nuxt
Complete guide to setting up an affiliate program in Nuxt. Step-by-step integration with Nuxt 3, server routes, and composables for Vue developers.
Create an Affiliate Program with WordPress
Complete guide to setting up an affiliate program in WordPress. Step-by-step integration with WordPress themes, plugins, and WooCommerce for any WordPress site.
Ready to Launch Your Squarespace Affiliate Program?
Get started with AffiliateBase today and start growing your Squarespace site with affiliate marketing.