Skip to main content

How to Create an Affiliate Program with Wix

Know what must work before you launch

Test Wix custom code and a supported checkout before inviting affiliates

Best fit
Teams evaluating AffiliateBase for a Wix 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 Wix merchants running a program for their own offers. It is separate from applying to Wix’s company affiliate program.

Wix’s official custom code guide requires a published site with a connected domain and warns that third-party code may be affected by Wix frontend security. Confirm that AffiliateBase loads on your live site before depending on it.

Wix Stores and Wix-hosted checkout do not expose an AffiliateBase handoff in this guide. Use AffiliateBase only with a Stripe Payment Link or merchant-controlled Checkout Session you can verify, then confirm the referral, sale, and commission.

Follow these steps to integrate AffiliateBase with your Wix site:

1

Add the Tracking Script

Add the AffiliateBase tracking script to your Wix site. In your Wix Editor, go to **Settings > Custom Code** and add this script to the **Head** 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 Wix 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 with Wix Velo (Advanced)

For advanced tracking using Wix Velo (Corvid), you can access the referral ID in your page code.
javascript
// 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;
    }
  });
});
4

Test Your Integration

Publish your Wix site and verify tracking is working with a test affiliate link.
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 Wix?

Wix can host custom code on eligible sites, but both script execution and checkout attribution need verification.

Simple Custom Code

Easy integration using Wix's custom code feature. Just copy and paste.

Stripe Integration

Use a Stripe Payment Link or Buy Button on the tracked page and verify the completed checkout; Wix Stores is not covered by this path.

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?
You'll need a Wix Premium plan to add custom code to your site's head section.
Can I track conversions from Wix forms?
Yes! You can use Wix Velo to inject the referral ID into form submissions.
Does AffiliateBase work with Stripe on Wix?
Payment Links and Buy Buttons can be tested on the same page as the script. Wix custom-code security and checkout behavior make live verification necessary.
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 Wix Affiliate Program?

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