How to Create an Affiliate Program with Webflow | AffiliateBase

Webflow is a powerful no-code platform for building beautiful, responsive websites. If you're running a Webflow 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 Webflow, from custom code integration to form submissions and Stripe payment tracking.

Whether you're building a marketing site, membership platform, or SaaS landing page with Stripe, an affiliate program can help you grow your user base and increase revenue.

Follow these steps to integrate AffiliateBase with your Webflow site:

1

Add the Tracking Script

Add the AffiliateBase tracking script to your Webflow site. Go to **Site Settings > Custom Code > Head Code** and paste this script. Using jsDelivr CDN ensures fast global delivery and automatic updates. No hosting required.
html
<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>
2

Test the Script

Publish your Webflow site and verify the script is loading correctly.
javascript
// Open browser console and check for:
console.log(window.AffiliateBase); // Should show the tracking object
console.log(window.affiliatebase_referral); // Empty string or referral ID
3

Integrate with Stripe Payment Links

If you're using Stripe Payment Links or Buy Buttons, add this additional script to automatically pass the referral ID. Add to **Custom Code > Footer Code**.
html
<!-- 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>
4

Track Form Submissions (Optional)

Add data-affiliatebase="true" to forms to auto-inject the referral ID. Add the data-affiliatebase attribute to any Webflow form to automatically include the referral ID when submitted.
html
<!-- Add data-affiliatebase="true" to your Webflow form wrapper -->
<!-- In Webflow Designer: select the Form Block, go to Settings, add Custom Attribute -->
<!-- Name: data-affiliatebase, Value: true -->

<!-- The referral ID will be automatically injected as a hidden field -->
5

Verify Tracking

Test your integration by visiting your site with an affiliate link.
javascript
// Visit your site with a test affiliate link:
// https://yoursite.webflow.io?via=test123

// Check the console:
console.log(window.affiliatebase_referral); // Should show "test123"

Why Use AffiliateBase with Webflow?

AffiliateBase is the perfect solution for Webflow users who want to add affiliate marketing without leaving the no-code platform.

No-Code Integration

Copy and paste the script in Webflow's custom code settings. No development required.

Stripe Integration

Works seamlessly with Stripe Payment Links, Buy Buttons, and Pricing Tables.

Form Integration

Track conversions from Webflow forms by adding a single attribute.

CMS Compatible

Works with Webflow CMS collections and dynamic content.

Frequently Asked Questions

Do I need coding knowledge to use AffiliateBase with Webflow?
No! Just copy and paste the script into Webflow's custom code settings. The integration is designed for no-code users.
Can I track conversions from Webflow forms?
Yes! Add data-affiliatebase="true" to your form and the referral ID is automatically included in submissions.
Does AffiliateBase work with Stripe on Webflow?
Yes, the tracking script automatically integrates with Stripe Payment Links, Buy Buttons, and Pricing Tables embedded on Webflow.
What tracking parameters does AffiliateBase support?
AffiliateBase automatically detects ?via=, ?ref=, ?affiliate=, and ?a= URL parameters.

Ready to Launch Your Webflow Affiliate Program?

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