Payment Links

For sites using Stripe Payment Links, Pricing Tables, or Buy Buttons.


When to Use This

Use this method if you:

  • Use Stripe Payment Links

  • Embed Stripe Pricing Tables

  • Use Stripe Buy Buttons

  • Build with no-code tools (Webflow, Framer, Carrd, etc.)


Step 1: Add the Scripts

Add this to all pages of your website, before the closing </body> tag:

<!-- PromoteBoost Tracker -->
<script src="https://api.promoteboost.com/tracker.js" data-org="YOUR_ORG_ID"></script>

<!-- Payment Links Attribution -->
<script>
document.addEventListener("DOMContentLoaded", function () {
  setTimeout(function () {
    const referralId = window.promoteboost_referral;
    if (!referralId) return;

    // Stripe Payment Links
    document.querySelectorAll('a[href^="https://buy.stripe.com/"]').forEach(function (link) {
      if (!link.href.includes("client_reference_id")) {
        const separator = link.href.includes("?") ? "&" : "?";
        link.href += separator + "client_reference_id=" + referralId;
      }
    });

    // Stripe Pricing Tables
    document.querySelectorAll("stripe-pricing-table").forEach(function (element) {
      element.setAttribute("client-reference-id", referralId);
    });

    // Stripe Buy Buttons
    document.querySelectorAll("stripe-buy-button").forEach(function (element) {
      element.setAttribute("client-reference-id", referralId);
    });
  }, 1500);
});
</script>

Find your Org ID in Settings → Integration.


Step 2: That's It!

The script automatically:

  1. Detects when a visitor came from an affiliate link

  2. Finds all Stripe payment elements on the page

  3. Adds the referral ID to each element

  4. Stripe includes it in the purchase


Why the 1500ms Delay?

Some website builders (Webflow, Framer, etc.) load Stripe elements dynamically. The delay ensures the script runs after everything is loaded.

If your elements load faster, you can reduce it:


Platform-Specific Instructions

Webflow

  1. Go to Project Settings → Custom Code

  2. Paste the script in the Footer Code section

  3. Publish your site

Framer

  1. Go to Site Settings → General → Custom Code

  2. Paste in the End of <body> tag section

  3. Publish

Carrd

  1. Go to your page settings

  2. Add an Embed element

  3. Choose Code and paste the script

  4. Set position to Footer

Squarespace

  1. Go to Settings → Advanced → Code Injection

  2. Paste in the Footer section

  3. Save


Testing

  1. Add ?ref=test123 to your URL

  2. Open DevTools → Console

  3. Check: console.log(window.promoteboost_referral)

  4. Inspect your Payment Link — it should have client_reference_id in the URL


Troubleshooting

Problem
Solution

Referral not added

Check if tracker.js is loading (Network tab)

Elements not found

Increase the setTimeout delay

Wrong affiliate credited

Clear cookies and test again


Done!

Sales from Payment Links are now tracked. Affiliates will see commissions in their portal.

Last updated