AutomationMart
Home/Browse/Extract Meta Ads detailed targeting across all endpoints using Google Sheets
n8n

Extract Meta Ads detailed targeting across all endpoints using Google Sheets

n8nn8n25 modulesv1.0
Google SheetsFacebook

Meta Ads Detailed Targeting Extractor (Universal, Switch by Endpoint) This workflow is a universal automation for all four Meta Detailed Targeting API endpoints: Search, Suggestions, Browse, and Validation. You use a single Google Sheets tab with an endpoint column; a Switch node routes each row to the correct branch; results are written to four separate sheets in the same spreadsheet. It is designed for media buyers, performance marketers, and analysts who manage targeting research, audience su

At a glance

Extract Meta Ads detailed targeting across all endpoints using Google Sheets is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Google Sheets, Facebook. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Google Sheets, Facebook
Modules
25
Price
Free
Version
v1.0
Extract Meta Ads detailed targeting across all endpoints using Google Sheets workflow diagram

About this workflow

Meta Ads Detailed Targeting Extractor (Universal, Switch by Endpoint) This workflow is a universal automation for all four Meta Detailed Targeting API endpoints: Search, Suggestions, Browse, and Validation. You use a single Google Sheets tab with an endpoint column; a Switch node routes each row to the correct branch; results are written to four separate sheets in the same spreadsheet. It is designed for media buyers, performance marketers, and analysts who manage targeting research, audience suggestions, browse trees, and validation in bulk and want one workflow instead of four. Use Case Working with Meta’s Detailed Targeting API usually means separate flows for search, suggestions, browse, and validation. This workflow is ideal if you want to: - Centralize targeting operations in one place: one input sheet, one workflow, four result sheets. - Drive everything from Google Sheets: add rows with endpoint (search | suggestions | browse | validation), adaccountid, and endpoint-specific parameters; run manually or on new rows. - Keep results organized by endpoint: searchresults, suggestionsresults, browseresults, validationresults in the same document. - Run on demand or on row add: use Manual Trigger for full-sheet runs or Google Sheets Trigger to process only new rows. How it Works The workflow is organized into clear blocks: 1. Trigger & input - Manual Trigger → Read Input (Google Sheets) — reads the entire targetingrequests sheet for ad-hoc or test runs. - Google Sheets Trigger — runs when a new row is added to targetingrequests; only new rows are processed (no re-processing of existing data). - Read Input (Google Sheets) always reads from the same sheet: targetingrequests. 2. Validation & routing - Valid rows (adaccountid + endpoint) — Filter node keeps only rows where both adaccountid and endpoint are non-empty. - Switch by endpoint — routes each row to one of four branches based on endpoint: search, suggestions, browse, or validation (values must match exactly, including case). 3. Each branch (Search, Suggestions, Browse, Validation) - API (Facebook Graph API) — calls the corresponding edge: targetingsearch, targetingsuggestions, targetingbrowse, or targetingvalidation with parameters from the row (act{adaccountid}/...). - Merge (combine by position) — merges the API response with the original request row so each result keeps context (e.g. adaccountid, q, targetinglist). - Split (field: data) — expands the API data array into one item per targeting result. - Format — maps fields to flat columns for the sheet: endpoint, adaccountid, query, limittype, targetingid, targetingname, audiencesizelowerbound, audiencesizeupperbound, path, description, type; for Validation branch, valid is also included. - Save to Google Sheets — appends to the branch-specific sheet: searchresults, suggestionsresults, browseresults, or validationresults. 4. Output - All four Save nodes write to the same spreadsheet (same Document ID), each to its own sheet. The valid column is populated only in validationresults; other sheets leave it empty. --- Input sheet: targetingrequests Required columns for every row: | Column | Description | |------------------|-------------| | endpoint | One of: search, suggestions, browse, validation (lowercase). | | adaccountid | Meta ad account ID (without the act prefix). | Endpoint-specific columns: | Endpoint | Required | Optional | |----------------|-----------------------|----------| | search | q — search query | limit (default 25), limittype, locale | | suggestions| targetinglist — JSON array, e.g. [{"type":"interests","id":"6003263791114"}] | limit (up to 45), limittype, locale | | browse | — | limittype, locale | | validation | One of: targetinglist, idlist, or namelist (string/JSON per Meta API docs) | locale | If search has no q, or suggestions / validation lack the required targeting input, the API call will fail. --- Output sheets (same document) Use the same Document ID in Read Input, Google Sheets Trigger, and all four Save nodes. Create (or let n8n create) these sheet names: | Sheet | Branch | Notes | |-----------------------|-------------|-------| | searchresults | Search | endpoint, adaccountid, query, limittype, targetingid, targetingname, audiencesize, path, description, type | | suggestionsresults | Suggestions | Same columns; query holds the targetinglist from the request | | browseresults | Browse | Same columns; query empty | | validationresults | Validation | Same columns + valid (true/false from API) | --- Setup Instructions 1. Credentials - Connect Google Sheets OAuth2 in: Read Input (Google Sheets), Google Sheets Trigger (if used), and all four Save nodes. - Connect Facebook Graph API credentials in each of the four API nodes (e.g. same “Facebook Graph” credential set). 2. Spreadsheet & sheets - Set the Document ID in: - Read Input (Google Sheets) — Document = your spreadsheet, Sheet = targetingrequests. - Google Sheets Trigger — same Document ID and sheet targetingrequests (if you use the trigger). - All four Save …results nodes — same Document ID; each node uses its own Sheet name: searchresults, suggestionsresults, browseresults, validationresults. - Create the input sheet targetingrequests with the columns described above and the four result sheets (or allow n8n to create them on first append). 3. Switch by endpoint - Ensure the endpoint column in targetingrequests contains exactly: search, suggestions, browse, or validation (lowercase, as in the Switch conditions). 4. Triggers - Keep Manual Trigger for full-sheet runs; use Google Sheets Trigger for row-added automation. When using the trigger, run the workflow only when new rows are added so existing rows are not processed again. 5. Activate - Save and activate the workflow. Test with a few rows per endpoint before processing large sheets. --- The workflow reuses the same patterns as other Meta Detailed Targeting templates: read from Sheets, call Facebook Graph API, Merge by position, Split Out on data, then append to Sheets. The difference is the single input sheet with an endpoint column, Switch-based routing, and four dedicated branches writing to four sheets in one spreadsheet.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Generate AI photos with Gemini & auto-post to FB, Instagram & X with approval

Social Media Foto Creation Bot with Approval Loop Create & Share AI Photos with Telegram, Gemini & Post to Facebook, Instagram & X Description This n8n workflow turns your Telegram messenger into a complete AI Photo Content Pipeline. You send your photo idea as a text or voice message to a Telegram bot, collaborate with an AI to refine the prompt and social media caption, let Gemini generate the image, and then automatically publish it after your approval to Facebook, Instagram, and X (Twitter)

Free

Create new rows in Google Sheets and new contacts in ActiveCampaign from new Google Contacts

This template periodically checks for new contacts in Google Contacts and uses the retrieved information to: a) Add new rows to a Google Sheets spreadsheet b) Add new contacts to ActiveCampaign The template is using [this sample](https://docs.google.com/spreadsheets/d/1Vzqfjb8q8Peh1QkcBNhYNri_T9rpS3Cz3BCSkhO6_Jo/edit?usp=sharing) Google Sheets spreadsheet as a destination for the new Google contacts. You should make a copy of it before configuring the template. The template is scheduled to run

Free

Create branded LinkedIn carousels with GPT-4o-mini, Figma templates & templated

AI-Powered LinkedIn Post Automation with Figma Templates 🧩 How It Works This workflow automatically generates professional, branded LinkedIn posts using your custom Figma designs. Perfect for marketers, agencies, content creators, and businesses who want to maintain consistent branding while automating social media content creation. Key Features: - Design-first approach using Figma templates - AI-powered content generation (optional) - High-quality image generation from templates -

Free

Send Go4Clients Mail to new Facebook Lead Ads leads

When you get new responses to your Facebook Lead Ads Form, Go4Clients will send an email to the respondent

Free

Add Google Sheets rows for new Mailparser.io emails

Every time a new email is parsed in mailparser.io, Make will automatically save a corresponding data row in Google Sheets.

Free

Create a Job in Facebook Insights (advanced) - PART 2

This scenario creates a request for Facebook Insights report. Once the request is submitted, a webhook is sent so the [other](https://www.integromat.com/en/integration/4266-export-data-from-facebook-insights-advanced-part-1-receiving-webhook) scenario can then check on its status and once it is ready, download the report.

Free

Learn JavaScript coding with an interactive RPG-style tutorial game

JavaScript Master Class - Interactive Code Tutorial 📚 How It Works This tutorial is designed as a self-paced learning experience where you explore working JavaScript code examples. Unlike traditional tutorials, you learn by examining real implementations and understanding how they work. 🔍 The Learning Method: 1. Execute first - See the workflow in action 2. Open each node - This is where the real learning happens! 3. Study the code - Read JavaScript implemen

Free

Summarize & reply to Slack channel messages with Claude AI assistant

What It Does Mello is a Claude-powered Slack assistant that helps you stay on top of unread messages across all your channels. It: - Summarizes conversations contextually using Claude AI. - Generates reply suggestions and sends them as private (ephemeral) Slack messages. - Lets you respond instantly with one-click AI-suggested replies. Perfect for busy teams, founders, and anyone looking to reduce Slack noise and save hours each week. --- 🔧 Setup Instructions 1. Create a Slac

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free