Facebook Lead Ads Source

Facebook Lead Ads is a popular lead generation marketing tool. It helps you generate leads at scale through forms, calling, and messaging solutions.

This guide will help you set up Facebook Lead Ads as a source in Datablit.

Prerequisites

  1. A Facebook business account.
  2. You must have created a form for your Facebook page from where you want Datablit to ingest the leads data.

Setup

  1. Go to your Datablit console > Event > Select or Create project > click Add Source. From the list of source type, select facebook_lead_ads.
  2. Specify a name for your source and click Create.
  3. Your Facebook Lead Ads source is now configured. Copy the Webhook URL:

Configure webhook

  1. Go to your Business Tools page and click All Tools > Instant Forms.
    Facebook Lead Ads setup
  2. Go to the CRM setup tab and search for Webhook.
    Facebook Lead Ads CRM setup
  3. Under Select source, select the source from where you want to ingest the lead data. Then, select the required Ad Account, Page, and Form under Choose settings.
    Facebook Lead Ads CRM setup source settings
  4. Under Select destination, click Create a new integration.
    Facebook Lead Ads CRM setup destination settings
  5. Configure the below settings in the resulting window. You can also configure the other settings as per your requirement. Then, click Authorize to proceed.
    SettingNotes
    URLYour source webhook URL obtained from the Datablit dashboard.
    MethodSet it to POST.
    Facebook Lead Ads CRM setup webhook settings
  6. Specify a name for the integration and click Continue.
  7. Go back to the CRM setup page where you will see the integration set up above. Click Continue to proceed.
  8. Optional: Add mappings and filters for incoming leads.
    Facebook Lead Ads CRM setup complete
  9. Click Test connection to test this integration. Make any changes to the setup as required, then click Save & publish.

Supported mappings

Datablit ingests the following Facebook Lead Ads properties as identify traits:

Facebook Lead Ads propertyDatablit property
iduserId
created_timeoriginalTimestamp

Datablit maps any other fields apart from the above mappings directly into the context.traits object, for example, marital_status, job_title, work_email, military_status, full_name, etc.

Sample payload and transformation

This section details how Datablit receives the data from Facebook Lead Ads and creates the resulting payload.

A sample payload sent by Facebook Lead Ads is shown:

http
POST /v1/webhook?apiKey=<source_api_key> HTTP/1.1
Host: <webhook-domain>
content-type: application/x-www-form-urlencoded
accept: */*

id=3960271960958574&created_time=02%2F01%2F2025%2010%3A20&first_name=First&last_name=Last&phone_number=%2B910123456789&custome_field=custom&street_address=Blue%20Street&city=Bengaluru&state=Karnataka&country=IN&date_of_birth=01%2F01%2F2000

Datablit transforms the above payload into the following identify payload:

json
{
  "traits": {
    "first_name": "First",
    "last_name": "Last",
    "phone": "+910123456789",
    "custome_field": "custom",
    "street_address": "some street",
    "city": "Bengaluru",
    "state": "Karnataka",
    "country": "IN",
    "date_of_birth": "01/01/2000",
  },
  "messageId": "message-id",
  "originalTimestamp": "2025-02-01T10:20:00.000Z",
  "type": "identify",
  "userId": "3960271960958574"
}