Add referral tracking to your Shopify store by editing your theme code. This takes just a few minutes.
In your Shopify admin, navigate to Online Store → Themes.
Find your current theme and click the "..." button, then select "Edit code".
In the Layout folder on the left sidebar, click on theme.liquid.
Find the </head> tag (you can use Ctrl+F or Cmd+F to search) and paste this script just before it:
<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.
Click Save in the top right corner of the code editor.
To verify the installation:
Visit your store with a test referral link (e.g., yourstore.myshopify.com?via=test)
Open your browser's developer console
Check if window.blossu_ref_id is defined
When a customer arrives at your store via a partner referral link, the script captures the referral and stores it as a cookie. When they complete a purchase, Blossu automatically attributes the sale to the referring partner.
The referral cookie persists for 60 days, so even if the customer leaves and comes back later, the referral will still be tracked.
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