Wix is a leading cloud-based web development platform that allows users to create HTML5 websites and mobile sites. If you're running a Wix 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 Wix, from custom code integration to form tracking and Stripe payment integration.
Whether you're running a business website, online store, or portfolio, an affiliate program can help you grow your audience and increase revenue.
Follow these steps to integrate AffiliateBase with your Wix 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 with Wix Velo (Advanced)
// In your Wix Velo page code
import wixWindow from 'wix-window';
$w.onReady(function () {
// Get referral ID from browser
wixWindow.getBrowserAPI().then(api => {
const referralId = api.window.affiliatebase_referral || '';
console.log('Referral ID:', referralId);
// Store in session or pass to forms
if (referralId) {
// Add to hidden form field
$w('#hiddenReferral').value = referralId;
}
});
});
Test Your Integration
// Visit your site with a test affiliate link:
// https://yoursite.wixsite.com/mysite?via=test123
// Open browser console and check:
console.log(window.affiliatebase_referral); // Should show "test123"
Why Use AffiliateBase with Wix?
AffiliateBase is the perfect solution for Wix users who want to add affiliate marketing to their websites.
Simple Custom Code
Easy integration using Wix's custom code feature. Just copy and paste.
Stripe Integration
Works seamlessly with Stripe Payment Links, Buy Buttons, and embedded checkout.
Wix Velo Support
Advanced users can leverage Wix Velo for custom tracking logic.
No Coding Required
Basic setup works with any Wix template without writing code.
Frequently Asked Questions
Do I need Wix Premium to use AffiliateBase?
Can I track conversions from Wix forms?
Does AffiliateBase work with Stripe on Wix?
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 Squarespace Site
Complete guide to setting up an affiliate program for your Squarespace site. Step-by-step integration with Squarespace code injection and forms for no-code users.
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 Wix Affiliate Program?
Get started with AffiliateBase today and start growing your Wix site with affiliate marketing.