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.

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
<script type="module" src="https://assets.sandbox.cello.so/attribution/latest/cello-attribution.js" async></script>

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:
  1. Add ?productId=test and ?ucc=test to your website URL
     https://yourwebsite.com/?productId=test&ucc=test
    
  2. Make sure that these values are saved in the cookies as cello-product-id and cello-referral
  3. Navigate to your signup page and try to access the ucc using the getUcc() method from the browser console
    window.CelloAttribution('getUcc')
    
    This method should return a promise with value test
    Promise {<fulfilled>: 'test'}
    
If this check passes, the script is installed correctly.