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
-
Referred visit
?via=partner
AffiliateBase captures the visit and generates a referral record.
-
Checkout handoff
referral ID
The checkout must carry the generated identifier into Stripe.
-
Paid event
$99 paid
A supported Stripe event confirms the attributed payment.
-
Commission
$19.80 due
An eligible attributed sale creates the commission record.
-
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:
Add the Tracking Script
Add the AffiliateBase tracking script to your WordPress site. You can add it via:
- Theme Customizer: Appearance > Customize > Additional Scripts
- Theme Files: Add to header.php before </head>
- Plugin: Use a header scripts plugin like "Insert Headers and Footers"
Use the pinned jsDelivr tracking URL for the latest published AffiliateBase release.
<script async src="https://app.affiliatebase.io/track.js" data-account-id="YOUR_ACCOUNT_ID"></script>Add via functions.php (Alternative)
Alternatively, add the script using WordPress hooks in your theme's functions.php file.
// 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
});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.
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.
<!-- 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>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?
Does AffiliateBase work with WooCommerce?
Can I use AffiliateBase with membership plugins?
What tracking parameters does AffiliateBase support?
Related Platform Guides
Create an Affiliate Program with Drupal
Add AffiliateBase tracking to Drupal, map the generated referral ID into a supported Stripe checkout, and verify the resulting commission.
Create an Affiliate Program with MemberPress
Install referral tracking on a MemberPress site, evaluate the plugin checkout handoff, and verify Stripe attribution before launch.
Create an Affiliate Program with Webflow
Add affiliate tracking to a published Webflow site, pair it with a supported Stripe checkout, and verify referral attribution before launch.
Ready to Launch Your WordPress Affiliate Program?
Get started with AffiliateBase today and start growing your WordPress site with affiliate marketing.