Skip to main content

Set up Stripe Payment Links with Tolt

Track Stripe payments from Payment Links and attribute them to partners.

Written by Nick

Set up Stripe Payment Links with Tolt so payments through your links are credited to the partner who referred the customer. Tolt adds each visitor's referral ID to your Payment Links, and Stripe passes it back with the payment.

  1. Go to Settings › Integrations, click Add integration, select Stripe and click Continue with Stripe.

  2. Open the Stripe payment links tab.

    Stripe integration page with the Stripe payment links tab selected
  3. Under Connect your Stripe account, click Install the Tolt app and follow the steps in Stripe.

  4. Under Add your Stripe Payment Link domain, keep buy.stripe.com, or choose Custom domain and enter the domain your Payment Links use.

  5. Copy the tracking script from Add the Tolt tracking script to your site and paste it into your website's <head> tag.

  6. Paste this script into the <body> of every page that has a Payment Link:

    <script>
    function updateButtonUrls() {
    var buttons = document.querySelectorAll('a[href^="https://buy.stripe.com"]');
    if (window.tolt_referral) {
    for (var i = 0; i < buttons.length; i++) {
    var btn = buttons[i];
    if (btn.href.indexOf("client_reference_id") === -1) {
    btn.href = btn.href + '?client_reference_id=' + window.tolt_referral;
    }
    }
    }
    }

    setTimeout(updateButtonUrls, 1000);
    setTimeout(updateButtonUrls, 1900);
    setTimeout(updateButtonUrls, 2600);

    window.addEventListener("tolt_referral_ready", function() {
    if (window.tolt_referral) {
    updateButtonUrls();
    }
    });
    </script>
  7. Click Save integration.

Payments through your Payment Links are now credited to the partner who referred the customer.

Good to know

  • For developers: the Stripe integration guide in Tolt's API docs has more code examples and explains how Tolt matches payments to partners.

  • If your Payment Links use a custom domain, change https://buy.stripe.com in the script to that domain.

  • To test without being charged, create a 100% off coupon in Stripe and use it for a test purchase. See Test the integration.

  • Need a hand? Contact us via chat and we'll set up Stripe with you.

Did this answer your question?