Setup Stripe Payment Button
Last updated
Last updated
The Buy Button, powered by Stripe Payment Links, lets you accept payments or sell subscriptions directly from your website without building a separate store. Create a button by selecting or creating a Payment Link, customising the products, and designing the checkout experience. The button supports over 20 payment methods, including cards, Apple Pay, and Google Pay, and adapts to your customer’s preferred language. Once configured, generate the embed code and paste it into your website to start accepting payments seamlessly.
In this guide, you will learn how to set up your buy button to track referrals. Once a successful payment is made through a referral link, Referral Rocket will track the referral.
To track referrals, add the ReferralRocket global script to your website. This script will automatically capture any referral links on your site.
Here’s how to add it:
You can find the global script under "Installation" on the Campaign Detail page in your Referral Rocket account.
This includes your unique Referral Rocket campaign ID
Copy the script and paste it into the landing page or the custom code section of your website, inside the <head> or <body> tags.
How to Add Custom Code with Popular Website Builders
Webflow: Go to Project Settings > Custom Code > Paste the script.
Framer: Open the project settings > Code tab > Paste the script.
WordPress: Use the header/footer plugin or paste it directly in the theme’s header file.
After adding the global script, the next step is to configure your buy button page. This script will track referral data and associate it with your Stripe payment information, allowing Stripe to properly track referral details.
Add this script to your payment page:
This script ensures that the referral code is included when the customer clicks the buy button, allowing Stripe to track the referral.
After adding the necessary scripts, you can test to ensure everything is working correctly with your Stripe integration. Follow these steps to perform a test:
Create a Test Affiliate Participant:
Go to the Referral Rocket hosted campaign widget, or embed it on your site.
You can use any email address to sign up as a participant.
Get the Referral Link:
After submitting, Referral Rocket will generate a unique affiliate link for the participant.
Open this link in a new tab. It will land you on your landing page.
Test the buy button:
Click the buy button to proceed to the Stripe Checkout page.
Use Stripe's Test Mode to avoid any charges while testing.
Complete the Payment:
Complete the test payment to verify that the referral information is being tracked correctly.
Head over to Referral Rocket and ensure that the referred participant is properly recorded in the system.
You can also check the reward section to confirm that rewards are being tracked and assigned.