Last updated

Lead Capture

The Lead Capture section provides tools for capturing customer leads and associating them with affiliate attribution.


What's Included

ItemTypeDescription
captureLeadFunctionCapture leads programmatically
<fluid-lead-capture-widget>ComponentLead capture form widget
Chat Settings APIAPIConfigure widget settings

Benefits

  • Affiliate Attribution — Leads are automatically associated with the current affiliate
  • Flexible Contact — Support for email or phone as primary contact method
  • Customizable Widget — Position, styling, and messaging options
  • Programmatic Control — Capture leads from custom forms or flows

Quick Example

// Capture a lead programmatically
await window.FairShareSDK.captureLead({
  message: "I'm interested in learning more",
  contact: {
    name: "John Doe",
    email: "john@example.com",
    phone: "+1 (800) 555-1234"
  }
});

<fluid-lead-capture-widget>

A customizable lead capture form widget.

Usage

<fluid-lead-capture-widget
  title="Have a question?"
  description="We'd love to get in touch!"
  submit-button-text="Send Message"
  success-message="Thank you! We'll get back to you soon."
  contact-method="email"
  position="bottom_right"
  size="60"
></fluid-lead-capture-widget>

Attributes

AttributeTypeDescription
primary-colorstringPrimary color (hex)
secondary-colorstringSecondary color (hex)
titlestringWidget title
descriptionstringWidget description
submit-button-textstringSubmit button text
success-messagestringMessage shown after submission
on-submitstringCustom submit handler
hide-widgetbooleanShow/hide widget
positionstringPosition (e.g., "bottom_right")
sizenumberWidget size
z-indexnumberCSS z-index
x-marginnumberHorizontal margin
y-marginnumberVertical margin
logo-srcstringLogo image URL
logo-altstringLogo alt text
footer-textstringFooter text
terms-urlstringTerms & conditions URL
contact-methodstring"email" or "phone"
attract-bubble-show-delaynumberDelay before showing bubble (ms)
attract-bubble-hide-delaynumberDelay before hiding bubble (ms)

Chat Settings API

Configure the lead capture widget programmatically.

// Set settings
window.FairShareSDK.chat.settings.set({
  title: "Contact Us",
  description: "We're here to help!",
  contactMethod: "email"
});

// Get current settings
window.FairShareSDK.chat.settings.get();

// Clear settings
window.FairShareSDK.chat.settings.clear();

Shorthand Alternatives

window.FairShareSDK.setChatSettings({ ... });
window.FairShareSDK.getChatSettings();
window.FairShareSDK.clearChatSettings();