Skip to content
All articles
Setup

Lead Ads (Meta and LinkedIn)

Every form submitted through your Facebook/Instagram ads (Meta Lead Ads) or LinkedIn ads (Lead Gen Forms) becomes a Lead in the CRM, using your own app (BYO model).

The Lead Ads integration uses YOUR app and YOUR page/ad account (this is the BYO, or "bring your own app", model). When someone fills out a lead form in a Facebook/Instagram (Meta) or LinkedIn ad, the CRM automatically creates a Lead and assigns an owner by round-robin, just like public form capture. The data comes straight from your ad account, with no intermediation on our side.

The integration starts inert: nothing happens until you fill in the credentials and turn it on. The App Secret and access tokens are stored encrypted in the CRM and are never displayed back to you.

Prerequisites

  • Meta: an app at developers.facebook.com, a Facebook Page that runs the ads, and the leads_retrieval and pages_manage_metadata permissions; you will need the App Secret and a long-lived page access token.
  • LinkedIn: an app at linkedin.com/developers with access to the Lead Sync / Advertising API and an OAuth access token with the r_marketing_leadgen_automation scope.
  • Have Lead forms (Meta Lead Ads / LinkedIn Lead Gen Forms) already created in your campaigns.
  • In Sellio, administrator access to save the credentials and enable the integration under Settings → Integrations.

How Meta works (Facebook/Instagram)

The Meta webhook does NOT send the form data. It only sends an identifier (leadgen_id). On receipt, the CRM verifies the event signature (HMAC-SHA256 of the body with your App Secret) and then FETCHES the lead from the Meta Graph API using your page access token, retrieving the submitted fields (field_data). Those fields are mapped to the Lead fields and the Lead is created.

Configure Meta: in the Meta dashboard

  1. Create (or use) an app at developers.facebook.com. Under Settings → Basic, copy the App Secret.
  2. Add the "Webhooks" product and the Leadgen object/product (Leads Access). Request the leads_retrieval and pages_manage_metadata permissions for your page.
  3. Generate a long-lived page access token for the page that runs the ads (Graph API Explorer or Business Manager).
  4. Keep everything handy: you will paste the App Secret, the page token, and a "verify token" (a string you choose) into the CRM.

Configure Meta: in the CRM

  1. Open Settings → Integrations and find the "Meta Lead Ads (Facebook/Instagram)" card.
  2. Verify token: choose any string and type it in. You will use the SAME value in the Meta dashboard.
  3. App Secret and Page access token: paste both (they are saved together, encrypted) and click "Save credentials".
  4. Copy the "Webhook URL (Meta)" that appears.
  5. Back in the Meta dashboard → Webhooks, paste that URL as the Callback URL and your verify token as the Verify Token. Meta performs a handshake (GET), and the CRM responds to the challenge if the verify token matches.
  6. Subscribe to the "leadgen" field of your page. Then return to the CRM and click "Enable".

Configure LinkedIn

On LinkedIn (Lead Gen Forms), create an app at linkedin.com/developers, request the Lead Sync / Advertising API products, and generate an OAuth access token with the lead gen scope (r_marketing_leadgen_automation). In the CRM, on the "LinkedIn Lead Gen Forms" card, paste the access token (and optionally the organization URN), save, and enable. Point your automation (or the pull of form responses) to the "Inbound URL (LinkedIn)", sending a JSON with the form fields.

Field mapping

Each mapping row links the NAME of a field from the ad form (on the left) to a Lead field (on the right, by api_name: email, name, phone, company, title…). Sensible defaults are included: full_name → name, email → email, phone_number → phone, company_name → company. Add rows only for custom fields in your form. If the form sends first_name and last_name separately (common on LinkedIn), they are combined into the name.

Example: Say you have a Meta form with full_name, email, phone_number, and a custom "budget" field. Map budget to a Lead field (segment, for example). The rest are already mapped by the defaults.
💡 Creation is idempotent: the same lead is not duplicated. The CRM dedupes by leadgen_id (webhook redelivery) and by email. If the form does not include an email, the lead is ignored, since email is the only required Lead field. If the "company" field is filled in, the CRM finds or creates the matching Company and links it.

Treat the webhook URL, the App Secret, and the tokens as secrets. Invalid signatures are rejected (401). Without the page access token, the CRM cannot fetch the lead data from the Graph API, which is why you paste the token together with the App Secret. One limitation to note: the native LinkedIn pull (subscribing to leadNotifications and then fetching the responses via API) is documented here and can be plugged in; today the route receives an already-normalized form response payload.

How to test

  1. Meta: in the Meta dashboard → Webhooks, the handshake (GET) already validates the verify token when you save the Callback URL. Then use Meta's "Lead Ads Testing Tool" (developers.facebook.com/tools/lead-ads-testing) to send a test lead on your form.
  2. Check in the CRM: a new Lead should appear with the mapped fields; if a company came through, the Company is found/created and linked.
  3. LinkedIn: trigger (or manually send) a form response payload to the "Inbound URL (LinkedIn)" and check the created Lead.

Troubleshooting

  • The Meta handshake fails: the verify token typed in the CRM must be IDENTICAL to the Verify Token in the Meta dashboard. Make them match and save.
  • You receive the webhook but no Lead is created: without the page access token, the CRM does not fetch the field_data from the Graph API. Paste the page token TOGETHER with the App Secret. Confirm the leads_retrieval/pages_manage_metadata permissions and that you subscribed to the page's "leadgen" field.
  • Invalid signature (401): the App Secret in the CRM differs from the Meta app (the signature is HMAC-SHA256 of the body with the App Secret). Re-paste the correct App Secret.
  • A lead without an email is ignored: email is the only required Lead field. Make sure the ad form has an email field.
  • Fields not filling in: review the Mapping (form field name to Lead api_name). On LinkedIn, first_name + last_name are combined into the name automatically.

Open this article inside the system

Read it and want to see it working?

The account is free and the whole manual is available inside the system, with an assistant that answers from this very content.

Create free account
Lead Ads (Meta and LinkedIn) · Sellio