Add a simple script tag to track referrals on any website. This works with any HTML page, static site, or custom web application.
Paste this snippet before the closing </head> tag on every page of your website. This script is lightweight (~2KB) and loads asynchronously so it won't affect page speed.
<script
async
src="https://js.blossu.com/v1/blossu.js"
data-program-id="YOUR_PROGRAM_ID"
></script>Replace YOUR_PROGRAM_ID with your actual program ID from the Blossu dashboard.
To verify the script is working correctly:
Visit your site with a test referral link (e.g., yoursite.com?via=test)
Open your browser's developer console (F12 or right-click and select "Inspect")
Type window.blossu_ref_id in the console and press Enter
You should see the referral ID (e.g., "test") displayed
You can also verify the installation by checking the Network tab in your browser's developer tools. Look for requests to js.blossu.com.
When a visitor arrives via a partner referral link (e.g., yoursite.com?via=partner), the script automatically captures the referral and stores it in window.blossu_ref_id and as a first-party cookie.
This ID persists for 60 days and is used to attribute purchases to the referring partner. Even if the visitor closes their browser and returns later, the referral will still be tracked.
The tracking script recognizes the following URL parameters:
?via=partner_code - The primary referral parameter
?ref=partner_code - Alternative referral parameter
Now that you have tracking set up, you need to connect your payment platform to automatically track conversions and calculate partner commissions.
Next article
How to track affiliates and revenue with Stripe