This guide works for any website or platform that allows you to add custom HTML. Whether you're using a CMS, a static site generator, or a custom-built application, these instructions will help you set up referral tracking.
This guide covers:
Wix
Ghost
Hugo
Gatsby
Jekyll
Carrd
Notion Sites
Custom HTML
Adding Blossu tracking to any website follows the same pattern: add a small JavaScript snippet to the <head> section of your HTML. Every website platform has a way to do this, though the exact steps vary.
Look for one of these options in your platform's settings:
"Custom Code" or "Code Injection"
"Head/Footer Scripts" or "Header Code"
"Tracking & Analytics" settings
"SEO Settings" (sometimes includes custom code options)
If you have direct access to your HTML files, look for the header.html file or the main template file.
Paste this snippet in the <head> section of your website. The 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.
After adding the script and publishing your changes:
Visit your site with a test referral link (e.g., yoursite.com?via=test)
Open your browser's developer console (F12 or right-click → Inspect → Console)
Type window.blossu_ref_id and press Enter
You should see "test" (or whatever referral code you used)
If window.blossu_ref_id is undefined, check these common issues:
Script not loading: Check the Network tab for requests to js.blossu.com. If there are none, the script wasn't added correctly.
Wrong program ID: Make sure you copied the correct program ID from your Blossu dashboard.
Caching: Clear your browser cache or try in an incognito window.
Changes not published: Make sure you saved and published your changes in your platform.
When a visitor arrives via a partner referral link (e.g., yoursite.com?via=partner), the script automatically:
Captures the referral code from the URL
Stores it in window.blossu_ref_id for immediate access
Saves it as a first-party cookie that persists for 60 days
This referral data is then used to attribute any purchases to the referring partner when you connect your payment platform.
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