Add referral tracking to your WordPress site using a plugin (recommended) or by editing your theme directly.
Go to Plugins → Add New in your WordPress admin dashboard. Search for "Insert Headers and Footers" by WPCode.
Click Install Now, then Activate the plugin.
Go to Settings → Insert Headers and Footers (or Code Snippets → Header & Footer depending on the plugin version).
Paste this code in the Header section and save:
<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.
Note
This method will be overwritten when you update your theme. We recommend using Option 1 or creating a child theme.
Go to Appearance → Theme Editor in your WordPress admin dashboard.
In the right sidebar, click on header.php (Theme Header).
Find the closing </head> tag and paste the tracking script just before it:
<script
async
src="https://js.blossu.com/v1/blossu.js"
data-program-id="YOUR_PROGRAM_ID"
></script>Click Update File to save your changes.
To verify the script is working:
Visit your site with a test referral link (e.g., yoursite.com?via=test)
Open your browser's developer console
Check if window.blossu_ref_id is defined
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