Skip to main content
Attribution script helps you to capture referral code on your landing pages and make it available at signup to attribute referral conversions to the right referrers. In addition, it helps you to personalize messages for referees on the landing page, get discount information and detect potential fraud and abuse of your referral program. Script Loading Context: The attribution script loads asynchronously and methods become available shortly after page load. All attribution methods use the unified window.CelloAttribution("methodName") syntax.

Adding the script

You can add attribution script to your website like any other third party JavaScript code by inserting the following code snippet into the <head> tag of each page on your website.
Make sure to use type="module" and async html params in the script tag

Verifying the installation

Now that you have added the attribution script to your website, make sure that the ucc is available on the signup page. To verify, follow these steps:

Step 1: Test with URL parameters

Add ?productId=test and ?ucc=test to your website URL:
Open browser developer tools (F12) and verify these values are saved in cookies:
  • cello-product-id should contain test
  • cello-referral should contain test

Step 3: Test method access

Navigate to your signup page and test the attribution methods from the browser console:
Expected result:

Troubleshooting Installation Issues

Script not loading

Methods return undefined

  • Wait longer for script initialization (try 3-5 seconds)
  • Check browser console for JavaScript errors
  • Verify script tag has type="module" and async attributes
  • Ensure no ad blockers are interfering
  • Check if cookies are enabled in browser
  • Verify no GDPR/cookie consent is blocking storage
  • Test in incognito mode to rule out extensions
Installation successful if methods return expected values and cookies are stored properly. Need help? Check the troubleshooting guide for common issues and solutions.