captureLead()
Captures a lead programmatically and associates them with the current affiliate attribution.
Signature
await window.FairShareSDK.captureLead(leadData);
Parameters
| Parameter | Type | Description |
|---|---|---|
leadData | object | Lead information |
LeadData Object:
| Property | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Lead's email address |
name | string | No | Lead's full name |
phone | string | No | Lead's phone number |
Returns
Promise<Lead> — The created lead object.
Example
// Capture a lead programmatically await window.FairShareSDK.captureLead({ email: "customer@example.com", name: "John Doe", phone: "+1234567890" });
Minimal Lead Capture
// Email only await window.FairShareSDK.captureLead({ email: "customer@example.com" });
Related
- Lead Capture — Lead capture component
- Attribution — Attribution component