πŸ“Š Extract Meta Ads detailed targeting across all endpoints using Google Sheets

⚑ 39 views Β· πŸ“Š Market Research & Insights

πŸ’‘ Pro Tip β€” If you’ve run into Facebook’s Graph API permission restrictions, ScraperNode is a community node that scrapes pages, groups, posts, and comments directly β€” no app review needed.

View All Scrapers

Description

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:

How it Works

The workflow is organized into clear blocks:

1. Trigger & input

2. Validation & routing

3. Each branch (Search, Suggestions, Browse, Validation)

4. Output


Input sheet: targeting_requests

Required columns for every row:

ColumnDescription
endpointOne of: search, suggestions, browse, validation (lowercase).
ad_account_idMeta ad account ID (without the act_ prefix).

Endpoint-specific columns:

EndpointRequiredOptional
searchq β€” search querylimit (default 25), limit_type, locale
suggestionstargeting_list β€” JSON array, e.g. [{"type":"interests","id":"6003263791114"}]limit (up to 45), limit_type, locale
browseβ€”limit_type, locale
validationOne of: targeting_list, id_list, or name_list (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:

SheetBranchNotes
search_resultsSearchendpoint, ad_account_id, query, limit_type, targeting_id, targeting_name, audience_size_*, path, description, type
suggestions_resultsSuggestionsSame columns; query holds the targeting_list from the request
browse_resultsBrowseSame columns; query empty
validation_resultsValidationSame columns + valid (true/false from API)

Setup Instructions

1. Credentials

2. Spreadsheet & sheets

3. Switch by endpoint

4. Triggers

5. Activate


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.

πŸ”— Nodes Used

Google Sheets, Facebook Graph API, Google Sheets Trigger, Filter

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup