Auto-Analyze Meta Ads Creatives with Parallel GPT-4 & Gemini in n8n
Input Meta Ads data or a Google Sheets list → extract metrics → send in parallel to OpenAI and Gemini against benchmarks → write ratings and action recommendations back to the sheet
- Who
- Performance marketing teams with n8n experience who need to batch-evaluate Meta ad creatives
- You get
- Auto-generate a high/medium/low rating, significance flag, and scale/optimize/stop recommendation per creative, aggregated in Google Sheets
- You need
- n8n · facebook-graph-api · google-sheets · openai · gemini · schedule-trigger
Constraints
Prerequisites: an n8n instance; credentials for facebookGraphApi, googleSheetsOAuth2Api, openAiApi, and googlePalmApi. You must prepare a CSV of historical benchmark creatives. Cost information is not provided by the source.
What they did
Author hotgomer published a 25-node n8n template that automates Meta Ads creative performance analysis. The workflow starts on a Schedule Trigger, fetches a list of creatives from either the Meta Ads API or a Google Sheet, extracts metrics such as spend, impressions, clicks, installs, registrations, add-to-cart, and checkouts, then sends each creative's CSV data together with a pre-set historical-benchmark CSV in parallel to OpenAI (gpt-4.1-nano) and a Gemini AI Agent. Both models return structured JSON containing evaluation, significance, summary, and recommendation, which the workflow writes back to the same Google Sheets row alongside the raw metrics.
How it went
The source reports the template can automatically: assign a high/medium/low rating per creative; flag statistical significance based on spend>49 and impressions>10,000; recommend scale, optimize, or stop; and ensure raw metrics are preserved in Sheets even if an AI call fails. (author_report)
Worth knowing
1. The prompts embed sample business context (EasyBusy, long sales cycle, no Purchases) that must be replaced with your own description and KPIs. 2. The quality of benchmarks_data directly determines AI rating accuracy; the source recommends using an Ads Manager export of top-performing creatives. 3. The workflow uses a googlePalmApi credential for Gemini, not the newest Gemini API; a newer n8n version may require a different credential type. 4. The OpenAI node calls gpt-4.1-nano, not GPT-4; the Gemini node temperature is set to 0.4. 5. The source's Further Ideas suggest auto-budget adjustment, Slack summary reports, and dynamic benchmark tabs, but these are suggestions, not built-in features. 6. This site has not tested the workflow; reproduction=not_tested. Run a small-data test first and verify Sheets column names match.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- Get Ads node: connect facebookGraphApi credentials.
- Get Insights node: connect facebookGraphApi credentials.
- Get Ad Details node: connect facebookGraphApi credentials.
- Google Gemini Chat Model node: connect Google Gemini/PaLM API credentials.
- Ad data from Gemini node: connect Google Sheets OAuth2 credentials.
- Ad data from OpenAI node: connect Google Sheets OAuth2 credentials.
- Send data to 4.1-NANO node: connect OpenAI API credentials.
- Ad metrics node: connect Google Sheets OAuth2 credentials.
- Get Ads from Sheet node: connect Google Sheets OAuth2 credentials.
Configuration to replace
- Source template is n8n public workflow #6545 (~25 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Configure credentials and the central parameters node
After importing the template into n8n, connect four credentials: Meta Ads, Google (for Sheets), OpenAI, and Google Gemini (Palm). Then open the ⚙️ Set parameters node and set three items: source to 'Meta' (pull from a campaign) or 'sheets' (read AdIDs from a Google Sheet); campaign_id to your Meta campaign ID if source=Meta; benchmarks_data to your own top-performing-creative CSV, with columns aligned to the template example.
Configure the three Google Sheets nodes
Point all three write nodes (Ad metrics, Ad data from OpenAI, Ad data from Gemini) to the same spreadsheet and sheet. Set Ad metrics Operation to Append or Update; set the other two to Update, matching on AdID. Ensure the sheet already has columns such as AdID, FileName, spend, impressions, evaluation, summary, recommendation, evaluation G, summary G, etc.
Set the trigger and activate the workflow
Set your desired frequency in the Schedule Trigger node. Save and activate the workflow. Run Execute Workflow manually before the first scheduled run to verify data lands correctly in Sheets. [First-test safety] Before the first test, create a separate test Google Sheet and temporarily point the three Sheets nodes (Ad metrics / Ad data from OpenAI / Ad data from Gemini) at that test sheet, or run with a small set of redacted rows; only after columns and writes look correct, switch back to the production spreadsheet and activate the Schedule Trigger.
Run parallel AI analysis (OpenAI + Gemini)
At runtime, merged creative data is converted to CSV by Code nodes and sent down two parallel branches: one to OpenAI (gpt-4.1-nano) to generate a JSON array of ratings; the other to a Gemini AI Agent (with Structured Output Parser) for an independent rating. Both results are written back to the same row, into OpenAI columns and Gemini columns respectively.
Execution prompt · Source text。OpenAI node Send data to 4.1-NANO system message
=You are the lead performance marketer at Digital Agency, a Meta Ads specialist. Your core strength is deep, objective analysis of creatives using funnel metrics (Impressions → Clicks → Installs → Registrations → Add to Cart → Checkouts Initiated). You compare test creatives with internal benchmarks and give clear recommendations on whether to scale, keep testing, or stop a creative. Your goal is to help make decisions, not just repeat the data.
Execution prompt · Source text。OpenAI node Send data to 4.1-NANO user message
=**BENCHMARKS_DATA (top-performing creatives with calculated metrics like CTR, CPC, CPA, ROAS, etc.)** *This is a CSV string with data from your top-performing creatives. All key metrics are pre-calculated here.* {{ $('Set parameters').item.json.benchmarks_data }} **ANALYSIS_DATA (raw test data without calculated metrics)**: {{ $json.creative_csv_data }} *Context*: • EasyBusy is a business aggregator. • Due to a long sales cycle (~30 days) and high average order value, there are no Purchases in the data. • We use Checkouts Initiated as a proxy conversion metric and also track the full funnel. **Your task**: 1. Calculate the same metrics for the test creatives as in the benchmark data (CTR, CPC, CPA, ROAS, etc.). 2. Compare each test creative against the benchmarks: • Metric-by-metric (e.g. higher CTR but worse CPC) • Funnel quality (is there drop-off or strength at any step?) 3. Answer the following: • Do we have enough data to draw conclusions for each creative? • Which creatives are ready to scale now? Why? • Which creatives should continue testing? • Which creatives should be stopped? OUTPUT FORMAT — ONLY JSON ARRAY OF CREATIVES: Do not write any explanation, markdown, or formatting outside of the array. Just return a single JSON array like this: You must include ALL creatives in a SINGLE JSON array — not split across multiple responses. Respond in ONE single message. Do NOT return one object per message. **Each object must follow this structure**: { "ad_id": "string (ad_id from ANALYSIS_DATA dataset)", "evaluation": "high | medium | low", "significance": "yes | no", "summary": "2–3 sentence explanation of why this creative got this score", "recommendation": "scale | optimize | stop" } *Example*: [ { "ad_id": "1202153606616005", "evaluation": "high", "significance": "yes", "summary": "CTR and CPC are significantly better than benchmarks, with a strong funnel down to Checkouts Initiated.", "recommendation": "scale" }, { "ad_id": "92021533361600510", "evaluation": "low", "significance": "yes", "summary": "Low CTR and high CPC. Almost no meaningful downstream activity.", "recommendation": "stop" } ] If there isn’t enough data, set "significance": "no" and clearly explain the reason in summary. Still provide the other fields. **Important**: • No markdown • No extra text • Output = only one clean JSON arrayExecution prompt · Source text。OpenAI node Send data to 4.1-NANO assistant message
=Do not return each creative in a separate message. You must return a SINGLE JSON array that includes ALL creatives from the dataset.
Execution prompt · Source text。Gemini AI Agent node Send data to Gemini text prompt
=You are the lead performance marketer at Digital Agency, a Meta Ads specialist. Your core strength is deep, objective analysis of creatives using funnel metrics (Impressions → Clicks → Installs → Registrations → Add to Cart → Checkouts Initiated). You compare test creatives with internal benchmarks and give clear recommendations on whether to scale, keep testing, or stop a creative. Your goal is to help make decisions, not just repeat the data. INPUT DATA **1. BENCHMARKS_DATA**: *This is a CSV string with data from your top-performing creatives. All key metrics are pre-calculated here.* {{ $('Set parameters').item.json.benchmarks_data }} **2. ANALYSIS_DATA (raw test data without calculated metrics)**: {{ $json.creative_csv_data }} Context: • EasyBusy is a business aggregator. • Due to a long sales cycle (~30 days) and high average order value, there are no Purchases in the data. • We use Checkouts Initiated as a proxy conversion metric and also track the full funnel. **Your task:** 1. Calculate metrics for each creative in ANALYSIS_DATA. Use the following formulas: - CTR (link click-through rate) = Link clicks / Impressions - CPC (cost per link click) = Amount spent (USD) / Link clicks - IPM (Installs per 1000 impressions) = App Installs / (Impressions / 1000) - Cost per App Install = Amount spent (USD) / App Installs - CR install to reg = Registrations completed / App Installs - Cost per registration completed = Amount spent (USD) / Registrations completed - Cost per add to cart = Amount spent (USD) / Adds to cart - Cost per checkout initiated = Amount spent (USD) / Checkouts initiated - If a denominator is zero, the resulting metric should be 0 or null. 2. Analyze each creative from ANALYSIS_DATA according to the following rules: - Rule for determining statistical significance (significance): --Consider the data sufficient ("significance": "yes") if BOTH of the following conditions are met: --- Amount spent (USD) > 49 --- Impressions > 10,000 Otherwise, set "significance": "no". -Rule for evaluation (evaluation): -- Compare the key metrics of the test creative (CTR, CPC, Cost per App Install, Cost per checkout initiated) against the average values of the same metrics from the BENCHMARKS_DATA file. -- "high": The creative significantly outperforms the benchmark averages on key funnel metrics (e.g., higher CTR, and lower CPC and Cost per checkout initiated). -- "medium": The creative shows mixed results or performs on par with the benchmarks. For example, a good CTR but an expensive Cost per checkout initiated. -- "low": The creative significantly underperforms the benchmarks on most key metrics. 3. Based on your analysis, provide a final JSON object containing the ad_id from the input data, and your calculated values for evaluation, significance, summary, and recommendation. For the summary, provide a 2-3 sentence explanation. If there is not enough data, set "significance" to "no" and explain why in the summary.
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to a setup assistant to confirm inputs and permissions before building
This block is the prompt. Ads are never placed here.
This template setup prompt: confirm you have configured the four credentials (facebookGraphApi, googleSheetsOAuth2Api, openAiApi, googlePalmApi), filled source, campaign_id (if applicable), and benchmarks_data CSV in the Set parameters node, then configure the three Google Sheets nodes to the same spreadsheet, set the Schedule Trigger, and activate.
Replace the EasyBusiness example context with your own business and KPIs; the quality of benchmarks_data directly affects rating accuracy.
Source
Meta Ads Performance Analysis with GPT-4 & Gemini AI Comparisons · hotgomer · n8n.io · 2025-07-28
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.