Skip to main content
Call kiflo('lead', ...) each time a new lead is submitted on your website — for example, when someone fills out a “Request a Demo” or “Contact Us” form. Kiflo reads the referral tracking cookie from the visitor’s browser, identifies which partner referred them, and records the lead with full attribution so your partner can be credited or rewarded.

Syntax

Both callback functions are optional. Omit them if you do not need to act on the result synchronously.

Example

Parameters

LeadObject

object
required
The properties of the lead as configured in your Kiflo account properties. The firstName and lastName fields are required. You can include any additional custom properties you have defined for leads.
string
The initial status to assign to the lead in Kiflo. Common values are "Accepted", "Pending", and "Rejected". If omitted, Kiflo applies the default status configured in your account.

How Kiflo tracks partner referrals

When a visitor follows a partner referral link to your website, the Kiflo JS snippet stores a unique tracking code in a first-party browser cookie (kfl_key). That cookie lives for up to 30 days. When a visitor later submits a form and you call kiflo('lead', ...), the SDK reads the cookie and automatically includes the tracking code in the request to Kiflo, attributing the lead to the originating partner.
If the visitor did not arrive through a partner referral link, no tracking cookie is present and the lead is created without partner attribution. The call still succeeds — Kiflo simply records the lead without an associated partner.
Place the kiflo('lead', ...) call inside your form’s submission handler, after you have validated the input but before redirecting the user. This ensures leads are reliably captured even if users close the tab immediately after submitting.