$50 free credit for new accounts - ends in

Claim $50

Integration

How to capture leads from Facebook ads into a CRM

How to capture leads from Facebook ads into a CRM — answered from your own docs. See how CRM teams use Chatref (lead-capture, custom-actions) to solve it. Start

Chatref Team6 min read / Updated June 15, 2026

When a Facebook ad drives a prospect to your site, Chatref can capture their details inside the chat and push that lead directly into your CRM using a custom action. The flow turns ad clicks into CRM contacts without manual entry or a separate form tool—it all happens inside the widget you already have on your page.

What connects to what

A Facebook ad campaign sends traffic to a landing page that includes your Chatref widget. When the visitor asks a question—about pricing, features, or setup—the agent answers from your own help docs while the lead-capture step collects their name, email, and any other fields you configured. Once captured, a custom action fires, posting the lead data to your CRM’s API. The CRM gets a new contact, and your sales team can follow up.

The pieces:

  • Facebook ad → a URL with the Chatref widget already embedded (no extra code)
  • Chatref lead capture → collects contact details right in the chat flow, triggered by a rule you set (after a certain number of messages, for instance)
  • Custom action → an HTTP call that sends the collected fields (name, email, question, source) to your CRM’s webhook or REST endpoint
  • Your CRM → receives a structured lead record and assigns it to the right owner or sequence

SaaS teams—especially those running CRM platforms—can connect this flow to HubSpot, Salesforce, Pipedrive, or any CRM that accepts inbound webhooks. The agent answers product questions while it captures the lead, so the prospect gets immediate value and you get a clean CRM entry without data entry lag.

How to set it up

  1. Deploy the Chatref agent on your campaign landing page
    You need a page that receives Facebook ad traffic and includes the Chatref embed snippet. If you haven’t added the widget yet, grab the snippet from your Chatref dashboard and place it in the page’s <head>. The agent doesn’t need to be re-trained; it can answer from your existing help content.

  2. Enable lead capture on the agent
    In the agent’s settings panel, open Lead Capture. Toggle it on, then choose which fields to collect. Common ones: name, email, company, and a free-form “What can we help with?” field. You can make some fields required, others optional.

  3. Decide when to ask for contact details
    Under lead-capture rules, set the trigger that tells the agent to show the form. Options include:

    • After a specific number of messages (e.g., after the third exchange)
    • When the agent detects buying-intent keywords (pricing, demo, trial)
    • Immediately on the first message (for a lead-gen-only chat) Choose the rule that fits your ad objective. For a cold Facebook ad audience, asking after two or three helpful replies often converts better.
  4. Create the CRM handoff custom action
    Go to Custom Actions and add a new action. Name it something clear like “Send to CRM.” Set the action to trigger on the “lead captured” event. Configure the HTTP request:

    • Method: POST
    • URL: Your CRM’s webhook or API endpoint (e.g., https://api.hubapi.com/crm/v3/objects/contacts)
    • Headers: Content-Type application/json plus any API key or bearer token your CRM requires
    • Body: A JSON payload that maps Chatref’s lead variables—{{lead.name}}, {{lead.email}}, {{lead.company}}, {{lead.message}}—to the fields your CRM expects

    Example mapping:

    {
      "properties": {
        "email": "{{lead.email}}",
        "firstname": "{{lead.name}}",
        "company": "{{lead.company}}",
        "hs_lead_source": "Facebook Ads"
      }
    }
    

    Replace the field names with whatever your CRM’s contact object expects.

  5. Test the end-to-end flow
    Use the Chatref playground or open your landing page in an incognito window. Trigger the chat, answer the agent, and let it show the lead form. Submit a test lead. In the Custom Actions logs (or your CRM’s audit log), verify that the action ran and the contact appeared. Fix any field mapping mismatches now, before ad traffic starts.

What users see

A visitor clicks your Facebook ad and lands on a page where the Chatref widget sits in the corner. They tap it and type a question like “Does this integrate with QuickBooks?” The agent replies with a short, sourced answer from your help docs—no guesswork.

After the configured trigger fires, the chat turns to a brief lead-capture form inside the same conversation thread. It might say: “I can have a specialist reach out with more details. Could you share your name and email?” The visitor fills in the fields and submits. The chat responds with a confirmation (e.g., “Thanks—someone from our team will be in touch soon.”). Behind the scenes, the custom action just fired and created the CRM contact, so when your sales team follows up, they already see the lead source (“Facebook Ads”) and the exact question the prospect asked.

The entire experience stays inside the widget—no redirect to a separate form, no browser tab switch. That keeps the visitor on your site and reduces drop-off.

Troubleshooting

Lead not reaching the CRM

  • Check your custom action logs in Chatref. A 4xx or 5xx error usually means the endpoint URL, authentication, or field mapping is wrong. Verify the CRM’s API token hasn’t expired and that the payload field names match the CRM’s expected format exactly (case-sensitive).
  • Ensure the action’s trigger is set to “lead captured.” If it’s set to something else (e.g., manual trigger only), the action won’t fire automatically.

Lead-capture form never shows

  • Confirm lead capture is enabled and the trigger rule isn’t too restrictive. If you set “after 5 messages” but the visitor asks only one quick question, the form won’t appear. Test with the minimum number of messages you’d expect from a typical ad click.
  • Look at the agent’s conversation history in the Chatref inbox. If the agent answers but never asks for details, the trigger condition may not be met (e.g., your buying-intent keyword list doesn’t include terms your ad audience uses). Adjust the keywords or switch to a message-count rule.

Duplicate leads created

  • Most CRMs let you deduplicate by email address. Enable that setting in your CRM to avoid double entries if the same person chats again later.
  • If the same lead is created twice during one session, check whether the custom action fires both on form submission and on a secondary event (like chat close). Restrict it to “on lead captured” only.

CRM receives data but UTM or ad attribution is missing

  • Chatref captures the lead, not the browser’s UTMs, but you can still tag the source. In the custom action body, add a static field like "lead_source": "Facebook Ads". If you run multiple campaigns and need campaign granularity, create separate Chatref agents (or separate custom actions) for each landing page and hardcode the campaign name.

FAQ

How do I move Facebook leads to a CRM?

Connect Chatref’s lead-capture feature to your CRM through a custom action. When a visitor submits their details in the chat, the custom action posts that data to your CRM’s webhook or API endpoint—no manual export or CSV upload needed.

How do I follow up Facebook ad leads?

By pushing leads into your CRM instantly, you give your sales team a real-time record that includes what the prospect asked. From there, use your CRM’s own sequences—auto-email, task creation, or a rep notification—to follow up within minutes, not hours, with context that matches their specific interest.

Put this into practice

Chatref answers your customers from your own content, day and night. Add it to your site and go live in minutes – free to start.

Get started