BILLmanager Knowledge Base

Creating cookie files for affiliate links from other resources

By default, the client's actions will be take into consideration in the referral program only if the client follows the link specified in the referral program settings.

To take into account the transition from any page of the website, insert the following script in the code of the website:

Script
<script language "javascript">
var urlParams = new URLSearchParams(window.location.search);
console.log(window.location.search); 
console.log(urlParams.has("from")); 
var from=urlParams.get("from");
var date=new Date(new Date().getTime() + 60 * 1000);  
document.cookie="billpartner="+from+"; path=/;expires=date.toUTCString();";
</script>

The script generates a billpartner cookie file with the from value passed to the URL. When registering in BILLmanager, the cookie is processed and the registration is linked to the partner with the corresponding billpartner ID.