Log Facebook leads to Google Sheets
Every new Facebook lead form submission is logged as a row in Google Sheets with the lead's contact details and the form, ad and campaign it came from, so follow-up starts from one list.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/log-facebook-leads-to-google-sheets/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Marketing · Lead management
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/log-facebook-leads-to-google-sheets
Set it up with the CLI
- Add it. Copies the folder into
zaps/log-facebook-leads-to-google-sheets/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/log-facebook-leads-to-google-sheets - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy log-facebook-leads-to-google-sheets - Check it. Its recent runs, with status and errors.
npx zap-pack logs log-facebook-leads-to-google-sheets
zaps/log-facebook-leads-to-google-sheets/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 2 to fill in
- connections/facebook-lead-ads.tsThe
facebook-lead-adsaccount it uses - connections/google-sheets.tsThe
google-sheetsaccount it uses - triggers/lead.tsWhat starts it:
facebook-lead-adslead2 to fill in - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a new lead from a Facebook Lead Ads form (
facebook-lead-ads,lead), for one Page and optionally one form. - Google Sheets adds one row (
google-sheets,add_row) to the lead log worksheet with the lead ID, created time, full name, email, phone number, form name, ad name and campaign name. Every lead gets a new row.
The Zap only writes to the sheet. It doesn't contact the lead.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | Where it lives | What goes there |
|---|---|---|
FACEBOOK_PAGE |
triggers/lead.ts |
The Facebook Page that owns the lead form. Ask which Page, then look up its ID with the user's Facebook Lead Ads connection. |
FACEBOOK_FORM |
triggers/lead.ts |
The lead form to log. Ask which form, then look up its ID. If they want every form on the Page, leave the form param out instead. |
SPREADSHEET_ID |
config.ts |
The lead log sheet. Ask which sheet it is, then look up its ID with the user's Google Sheets connection. |
WORKSHEET_ID |
config.ts |
The tab that gets the rows. Ask which tab, then look up its ID with the user's Google Sheets connection; the first tab is "0". |
Also ask about the sheet's columns. The COLUMNS map at the top of workflow.ts sends lead fields to column keys such as COL$A, not header names. The sheet's header row must match it: lead ID, created time, full name, email, phone number, form name, ad name, campaign name, in columns A to H. If the user's sheet is laid out differently, change the map, or add headers to match.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/log-facebook-leads-to-google-sheets, replace each REPLACE_… value as this file says, then run npx zap-pack deploy log-facebook-leads-to-google-sheets, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. Either way, name the workflow Log Facebook leads to Google Sheets (zapier.sh/log-facebook-leads-to-google-sheets): zap-pack takes that name from this file's title, so leave the title as it is, and with Zapier MCP give the workflow that name when you create it. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
facebook-lead-ads(the Facebook account that owns the lead form's Page, used by the trigger) andgoogle-sheets(the account that owns the lead log sheet) to the user's connections. No other app needs a connection. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/lead.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them, with the trigger'spageandformset to the user's answers. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections and sample the trigger before the first test run, and fix any key in
workflow.tsthat doesn't match, such as the lead field names (form_name,ad_name,campaign_name).
Test it
Run this sample as a draft test run (run_workflow_draft in Zapier MCP) before publishing, pointed at a copy of the lead log sheet:
{
"id": "lead-1001",
"created_time": "2026-12-01T09:30:00+0000",
"full_name": "[install-test] Jane Example",
"email": "jane.example@example.com",
"phone_number": "+15550100100",
"form_name": "[install-test] Spring Promo",
"ad_name": "[install-test] Spring Promo Ad",
"campaign_name": "[install-test] Spring Campaign"
}
Confirm one new row appears with these values in the mapped columns. If run-status tools aren't available, check the result in Google Sheets directly. Ask the user to delete the test row; the agent doesn't delete it.
Then publish and confirm the trigger is active.
Notes
- Facebook lead field names depend on the Zapier trigger version. If a column comes through blank, sample the trigger and update the input schema and
COLUMNSmap inworkflow.ts. - To log extra answers from the form, add a column to the sheet and a matching entry in
COLUMNS, the schema and theadd_rowinputs. - Each submission adds a row, so a lead that submits twice appears twice. To alert the sales team, add a Slack message or email after the row is created.
- The sheet holds leads' names, emails and phone numbers. Share it only with the people who follow up, and don't commit a real spreadsheet ID to a repository.