kiflo('customer', ...) each time a new user signs up on your website. Kiflo reads the referral tracking cookie that was set when the visitor first arrived through a partner link, and uses it to attribute the new customer to the correct partner. This attribution is what triggers any rewards or commissions you have configured for your partners.
Syntax
Example
Parameters
CustomerObject
object
required
The properties of the customer as configured in your Kiflo account properties. An
email field is required inside this object. You can include any additional custom properties you have defined.How Kiflo tracks partner referrals
When a visitor arrives on your website through a partner’s unique referral link, Kiflo JS automatically writes the referral tracking code into a first-party browser cookie (kfl_key). The cookie persists for up to 30 days, so a visitor can return multiple times before signing up and still be correctly attributed.
When you call kiflo('customer', ...), the SDK reads that cookie and sends the tracking code along with the customer’s properties to Kiflo in a single request. No manual work is needed — cookie reading and attribution happen transparently.
The cookie is set on the visitor’s browser, so
kiflo('customer', ...) must be called from client-side JavaScript (i.e., in the browser) to work correctly. If you call it server-side, there is no browser context and no cookie to read.Creating customers from backend code (API)
If your sign-up flow processes new users on the server rather than in the browser, you cannot call the JS SDK from your backend. Instead:- Use
kiflo('getTrackingCode')in the browser to read the current referral tracking code. - Send that tracking code to your server alongside the rest of the sign-up data.
- Call the Kiflo REST API from your backend to create the customer, passing the tracking code in the request so Kiflo can perform attribution.
