# Meta Lead Ads Import via Make — Setup Guide

This guide walks you through connecting your Facebook/Instagram lead ads to Leads Tracker using Make.com. The setup integrates your lead-gen forms with Leads Tracker's central database, so new leads appear instantly in the **Meta Leads** panel.

---

## Prerequisites

- A Leads Tracker account with CEO/organization role
- A Facebook Page with at least one lead-gen form (standard forms only — not recruiting forms)
- Internet access

---

## Step 1: Create a Make Account (EU Zone)

Make.com's infrastructure is deployed in multiple zones (US, EU, etc.). **For GDPR compliance and EU data residency, you must create your account on the EU zone.**

1. Go to **eu1.make.com** or **eu2.make.com** (both are EU zones; either works)
2. Click **Sign up**
3. Enter your email, create a password, and verify your email
4. Complete the account setup wizard

**Why EU?** Lead data (names, emails, phone numbers) is personal information and must be processed within the EU for legal compliance. Choosing the wrong zone will cause regulatory issues.

---

## Step 2: Generate Your Import Key & Copy the Endpoint URL

Now you'll get the credentials that Make needs to send leads back to Leads Tracker.

1. Log in to **Leads Tracker**
2. Open **Settings** (bottom-left icon or gear in the top menu)
3. Navigate to the **Meta Lead Import** section
4. Click **Generate / Rotate key**
   - A full key appears on screen — **copy it immediately** (shown only once)
   - Note the **inbound endpoint URL** above it: `https://www.leads-tracker.de/api/integrations/inbound`
5. Keep both the **key** and **URL** in a safe place (you'll paste them into Make next)

---

## Step 3: Download & Import the Make Blueprint

The blueprint contains the pre-built scenario (workflow) that fetches leads from Facebook and sends them to Leads Tracker.

1. In the **Meta Lead Import** section, click the **Download Make blueprint** link
   - This downloads `make-blueprint.json` to your computer
2. In Make (logged in on the EU zone):
   - Click **Create a scenario** (or **Create** → **Scenario**)
   - In the wizard, look for **Import Blueprint** or click **⋯ → Import Blueprint**
   - Select the downloaded `make-blueprint.json` file
   - Make will parse it and show you a preview of two modules: **Facebook Lead Ads** → **HTTP**
   - Click **Import** or **Confirm**

---

## Step 4: Connect Facebook & Select Your Lead-Gen Form

The Facebook module needs permission to read your lead ads and must be pointed at your form.

1. In the scenario, click the **Facebook Lead Ads** module (the first box on the left)
2. Click the connection icon (plug icon) or **Connect**
3. A popup opens — choose **Facebook App / Page**
   - If this is your first time, Make will ask for login and permissions to your Facebook account
   - Grant permissions for **Pages** and **Lead Ads** access
4. Once connected, you'll see fields:
   - **Page**: Select the Facebook Page that owns your lead-gen form
   - **Form**: Select your **lead-gen form** (e.g., "Newsletter Signup", "Demo Request")
   - **Important:** Do NOT select recruiting forms — select only standard lead-gen forms
5. Click **OK** or **Save** to confirm

---

## Step 5: Configure the HTTP Module & Paste Your Key

The HTTP module sends the leads to Leads Tracker. You'll set the endpoint and authentication.

1. In the scenario, click the **HTTP** module (the second box on the right)
2. Set the following:
   - **Method**: POST
   - **URL**: Paste the inbound endpoint URL from Step 2 (`https://www.leads-tracker.de/api/integrations/inbound`)
   - **Headers**: Add a header named `Authorization` with value `Bearer <your-key>`
     - Replace `<your-key>` with the full key from Step 2
     - The header will look like: `Authorization: Bearer org_1234567890abcdefghijklmnop_xyz...`
3. **Request body** (JSON): The blueprint ships with **placeholders** for the three contact fields — `YOUR_NAME_FIELD`, `YOUR_EMAIL_FIELD`, `YOUR_PHONE_FIELD` — because every Facebook form names its fields differently. You **must** replace each one:
   - Delete the placeholder text (e.g. `YOUR_NAME_FIELD`) but **keep the two surrounding quotes** `""`
   - From the field picker that pops up on the right, **drag the matching blue box** from the Facebook Lead Ads module's output (the fields under **Field data**) into the gap, so the blue box sits **inside the quotes** — e.g. `"fullName": "{{1.data.full_name}}"`
   - Repeat for email and phone. **Every dragged blue box must stay between its `""` quotes**, otherwise the JSON breaks
   - `YOUR_SOURCE_TAG-OPTIONAL-WRITE` and `YOUR_LABEL-OPTIONAL-WRITE` are **optional** — replace them with the literal tag/label text you want on each lead from this form (plain text you type, **not** blue boxes), or **delete those two lines** if you don't want any
   - Leave the other mappings (`leadgenId`, `createdTime`, `platform`, `campaignName`, `adsetName`, `adName`) as-is — those are standard fields that work for every form
4. Click **OK** or **Save**

---

## Payload Field Mapping

The HTTP module must POST a JSON body with this structure:

```json
{
  "leadgenId": "<unique-lead-id>",
  "createdTime": "<ISO-8601-datetime>",
  "platform": "Facebook" | "Instagram",
  "formId": "<form-id>",
  "formName": "<form-name>",
  "campaignName": "<campaign-name>",
  "adsetName": "<ad-set-name>",
  "adName": "<ad-name>",
  "fullName": "<lead-name>",
  "email": "<lead-email>",
  "phone": "<lead-phone>",
  "customFields": {
    "<question-label>": "<answer>",
    "Stadt": "<city>",
    "Bundesland": "<state>"
  }
}
```

**Field meanings:**

- **leadgenId**: Unique identifier for the lead submission (FB provides this)
- **createdTime**: Timestamp when the lead submitted the form (ISO 8601 format)
- **platform**: Either "Facebook" or "Instagram" (from the ad's platform)
- **formId**, **formName**: the lead-gen form's id and name
- **campaignName**, **adsetName**, **adName**: the **names** of the campaign / ad set / ad (map Facebook's *Name* fields, not the numeric IDs — these show up as "Campaign", "Adset", and "Ad" on the lead)
- **fullName**, **email**, **phone**: Lead contact info (from form fields)
- **customFields**: Custom questions from your form
  - If your form includes a question like "Which city?" or "Bundesland?", Make will extract it here
  - Leads Tracker looks for **Stadt** (city), **Bundesland** (state), and **Land** (country) and uses them to populate the location
  - Other fields (e.g., "Beruf" = profession, "Company" = company name) are folded into the lead's notes

**Example (German form):**

```json
{
  "leadgenId": "lg_1234567890",
  "createdTime": "2026-06-18T14:30:00Z",
  "platform": "Instagram",
  "formId": "f_100",
  "formName": "Beratung Anfragen",
  "campaignName": "Sommer Beratung 2026",
  "adsetName": "Bayern 30-50",
  "adName": "Video – Altersvorsorge",
  "fullName": "Anna Schmidt",
  "email": "anna@example.com",
  "phone": "+49 170 123 4567",
  "customFields": {
    "Wie heißt du?": "Anna Schmidt",
    "Stadt": "München",
    "Bundesland": "Bayern"
  }
}
```

The blueprint maps the standard fields for you (`leadgenId`, `createdTime`, `platform`, `campaignName`, `adsetName`, `adName`). You only fill the three contact-field placeholders by dragging the matching blue boxes from the Facebook module — see **Step 5** — keeping each one **inside its `""` quotes** so the JSON stays valid.

### Optional: per-form tags & labels

You define the source tags and labels for every lead from this form by adding two
optional arrays to the JSON body (since each Make scenario handles one form):

- `sourceTags`: the exact source tags applied to each lead — nothing is added
  automatically. Omit the field (or send `[]`) for no tags.
- `labels`: the labels applied to the promoted lead.

(The platform is already stored separately, and these leads are always marked as
coming from the Meta connector, so you don't need tags for either.)

Add them alongside the other fields in the same JSON body. Full example:
```json
{
  "leadgenId": "lg_1234567890",
  "createdTime": "2026-06-18T14:30:00Z",
  "platform": "Instagram",
  "formName": "Beratung Anfragen",
  "fullName": "Anna Schmidt",
  "email": "anna@example.com",
  "phone": "+49 170 123 4567",
  "sourceTags": ["Webinar Q3", "Finanzberatung"],
  "labels": ["hot-lead", "webinar-2026"]
}
```

---

## Step 6: Turn On & Test

Now activate the scenario and verify it works.

1. In Make, look for the **power button** or toggle (usually top-right of the scenario)
   - Click it to turn the scenario **ON**
   - You should see a green status indicator
2. Back in **Leads Tracker** → **Meta Leads** tab, you should see a count (e.g., "Meta Leads (0)")
3. **Test with a real lead submission:**
   - Open your Facebook Page's lead-gen form (visit it from the Page or click the ad)
   - Fill out and submit the form manually
   - Wait 10–30 seconds for Make to poll and forward the lead
   - Refresh **Leads Tracker** → the lead should appear in **Meta Leads**
4. **Use Meta's Lead Ads Testing Tool (optional):**
   - In Facebook Ads Manager, go to **Tools** → **Lead Ads Testing Tool**
   - Select your form and send a test lead
   - Confirm it appears in Leads Tracker within 30 seconds

---

## Troubleshooting

### 401 Unauthorized (or "Unauthorized" error in Make)

**Symptom:** Make shows a red X on the HTTP module; Leads Tracker doesn't receive leads.

**Cause:** The Authorization header is incorrect or the key has been rotated.

**Fix:**
1. In Leads Tracker Settings → Meta Lead Import, check if the key has changed
2. If you clicked **Generate / Rotate key** recently, a new key is active
3. Copy the new key prefix and rotate (if needed)
4. Update the **Authorization** header in Make with the new key:
   - `Authorization: Bearer <new-key>`
5. Save and re-run the scenario

### No Leads Arrive (Form Still Not Connected, or Scenario Off)

**Symptom:** You submit a test lead, but it doesn't appear in Leads Tracker.

**Cause(s):**
- The scenario is not turned ON
- The Facebook Lead Ads module is not connected or the form was not selected
- Make's webhook is not polling (timing issue)

**Fix:**
1. Check the **power button** in Make — ensure it's **ON** (green indicator)
2. Click the **Facebook Lead Ads** module and verify:
   - **Page** is selected
   - **Form** is selected (and it's a lead-gen form, not a recruiting form)
   - The connection shows "Connected" (not "Not connected" or "Requires reconnection")
3. Try submitting the form again from your Page, then wait 30 seconds
4. If still no leads, check Make's **Execution History** (bottom of the screen):
   - Click the most recent run
   - Look for error messages (e.g., "Form not found", "Authentication failed")
   - If an error appears, share it for support

### Wrong Form Selected (Recruiting Form)

**Symptom:** The form doesn't send leads at all, or leads are missing fields.

**Cause:** A recruiting form (used for job applications) was selected instead of a standard lead-gen form.

**Fix:**
1. In Make, click the **Facebook Lead Ads** module
2. Under **Form**, deselect the recruiting form
3. Select only a **lead-gen form** (standard ad form for customer leads)
4. Save and test again

### GDPR / Data Residency Concern

**Symptom:** Compliance team flags that leads are not being processed in the EU.

**Cause:** The Make account was created in the US zone (make.com instead of eu1.make.com / eu2.make.com).

**Fix:**
- Create a new account on **eu1.make.com** or **eu2.make.com**
- Re-import the blueprint and set up the scenario there
- Delete the US-zone scenario (if no longer needed)
- All lead data will now flow through EU infrastructure

---

## Next Steps

- Once leads flow in, they appear in the **Meta Leads** panel in Leads Tracker
- You can assign, qualify, and track them like any other lead
- To stop receiving leads, turn the scenario **OFF** in Make (or disconnect the Facebook connection)
- To rotate your API key (e.g., for security), go to Leads Tracker Settings → **Generate / Rotate key**

---

## Questions?

For help setting up Make, visit [Make Documentation](https://www.make.com/en/help).  
For Leads Tracker-specific issues, contact your support team.
