Stripe Checkout Sessions
This guide shows you how to integrate referral codes from Referral Rocket into your Stripe checkout sessions, allowing you to track referrals and attribute conversions properly.
Step 1: Install Referral Rocket SDK
First, install the Referral Rocket library by adding the script to the <head>
section of your website. Replace YOUR-CAMPAIGN-ID
with your actual campaign ID.
Step 2: Retrieve Referral Code
Use the getReferralCode()
function to retrieve the referral code stored in cookies. This function returns the referral code if available, or null
if no referral code is found.
Step 4: Create Stripe Checkout Session with Referral Code
When creating your Stripe checkout session, include the referral code in the client_reference_id
field. This allows you to track which purchases came from referrals.
Last updated