Skip to main content

WordPress Affiliate Program Setup with Stripe

Know what must work before you launch

Install sitewide tracking and verify the exact checkout plugin or Stripe flow

Best fit
Teams evaluating AffiliateBase for a WordPress 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 a WordPress merchant running an affiliate program for its own products or memberships. WordPress can load the tracking script, but the CMS does not determine whether a sale is attributable.

You need administrator access for a sitewide script and a checkout that passes AffiliateBase’s generated referral ID to Stripe. WordPress may strip scripts from content for users without the required capability, as described in the official Custom HTML documentation.

WooCommerce, MemberPress, and other plugins own their checkout requests. Treat each as unverified until its Stripe request contains the generated referral ID. For a directly embedded Payment Link or custom Checkout Session, follow the Stripe guide and verification checklist.

Follow these steps to integrate AffiliateBase with your WordPress site:

1

Add the Tracking Script

Add the AffiliateBase tracking script to your WordPress site. You can add it via: 1. **Theme Customizer**: Appearance > Customize > Additional Scripts 2. **Theme Files**: Add to header.php before 3. **Plugin**: Use a header scripts plugin like "Insert Headers and Footers" 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

Add via functions.php (Alternative)

Alternatively, add the script using WordPress hooks in your theme's functions.php file.
php
// Add to your theme's functions.php
add_action('wp_head', function() {
?>
<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://app.affiliatebase.io/track.js" data-account-id='YOUR_ACCOUNT_ID'></script>
<?php
});
3

Integrate with Stripe

For custom Stripe Checkout, submit AffiliateBase’s generated referral ID from the browser to your server and use it as client_reference_id. Generic WooCommerce order metadata is not enough.
4

Use Stripe Payment Links or Buttons (Optional)

If using Stripe Payment Links or Buy Buttons on your WordPress 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>
5

Test Your Integration

Open the exact setup-test link generated by AffiliateBase, complete the chosen checkout, and verify the referral, sale, and commission records.

Why Use AffiliateBase with WordPress?

WordPress can host the script; each commerce or membership checkout still needs its own attribution test.

Easy Installation

Add a single script tag to your WordPress site. No plugin required.

WooCommerce Requires Verification

The gateway must pass the generated referral ID into the Stripe payment path. Generic order metadata does not establish AffiliateBase attribution.

Membership Plugins Own Checkout

Use the matching platform guide and verify the exact membership plugin and gateway before launch.

Stripe Integration

Track conversions from Stripe payments on your WordPress site.

Frequently Asked Questions

Do I need a WordPress plugin for AffiliateBase?
No! AffiliateBase works via a simple script tag. No WordPress plugin is required, making it lightweight and fast.
Does AffiliateBase work with WooCommerce?
Not by default. A WooCommerce integration must pass the generated referral ID into the Stripe object that AffiliateBase processes; test the full path.
Can I use AffiliateBase with membership plugins?
The script can run on WordPress, but each plugin controls checkout. Treat compatibility as unverified until a completed payment creates the expected sale and commission.
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 WordPress Affiliate Program?

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