Skip to main content

Meta Ads Performance Analysis with GPT-4 & Gemini AI Comparisons

Workflow preview

Workflow preview
100%
Meta Ads Performance Analysis with GPT-4 & Gemini AI Comparisons preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow transforms raw Meta Ads data into actionable, expert level insights. It acts as a virtual performance marketer, analyzing each creative's performance, comparing it against your histor...

Best for

  • Market Research automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.facebookgraphapi, n8n-nodes-base.splitout, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.outputparserstructured, @n8n/n8n-nodes-langchain.lmchatgooglegemini

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Kirill Khatkevich.

Original n8n.io source

1.1 Workflow description

Title
Meta Ads Performance Analysis with GPT-4 & Gemini AI Comparisons
Workflow name
Meta Ads Performance Analysis with GPT-4 & Gemini AI Comparisons

This workflow transforms raw Meta Ads data into actionable, expert-level insights. It acts as a virtual performance marketer, analyzing each creative's performance, comparing it against your historical benchmarks, and delivering clear recommendations on whether to scale, optimize, or stop the ad. By running parallel analyses with both OpenAI and Gemini, it provides a unique, dual-perspective evaluation. This template is the perfect sequel to our "Automation of Creative Testing" workflow but also works powerfully on its own.

Use Case

Manually sifting through ads manager reports is tedious, and identifying true winners from early data is challenging. This workflow solves these problems by automating the entire analysis pipeline. It's designed for performance marketing teams who need to:

  • Make faster, data-driven decisions on which creatives to scale.
  • Get objective, AI-powered second opinions on ad performance.
  • Systematically evaluate creatives against consistent, pre-defined benchmarks.
  • Maintain a central log in Google Sheets with both raw metrics and qualitative AI analysis.
  • Save hours spent on manual data crunching and report generation.
How it Works

The workflow is structured into three logical stages:

  1. Configuration & Data Ingestion:
  • A central ⚙️ Set parameters node holds all key variables: the data source (Meta or Sheets), campaign_id, and, most importantly, your historical performance benchmarks as a simple text block.
  • An IF node directs the workflow to fetch data either directly from a Meta Ads campaign or from a specified Google Sheet (ideal for analyzing a curated list of ads).
  1. Data Processing & AI Analysis (Parallel Execution): After fetching raw performance data (spend, impressions, clicks, actions), the workflow splits into three parallel branches for maximum resilience:
  • Branch 1 (Data Logging): Immediately writes or updates a row in Google Sheets with the raw metrics for the creative. This ensures no data is lost, even if the AI analysis fails.
  • Branch 2 (OpenAI Analysis): Prepares a CSV string of the creative's data, sends it along with the benchmarks to an OpenAI model (e.g., GPT-4), and instructs it to return a structured JSON analysis.
  • Branch 3 (Gemini Analysis): Performs the exact same process but using Google's Gemini model via a LangChain agent, providing a second, independent evaluation.
  1. Results Aggregation:
  • The results from both AI models are received as structured JSON.
  • Two final Google Sheets nodes take these results and update the original row (matching by AdID), adding the evaluation, significance, summary, and recommendation into separate columns. The final sheet contains a complete picture: raw data side-by-side with analyses from two different AIs.

Setup Instructions

  1. Credentials: 1.1 Connect your Meta Ads account. 1.2 Connect your Google account (for Sheets). 1.3 Connect your OpenAI account. 1.4 Connect your Google Gemini (Palm) account.
  2. The ⚙️ Set parameters Node: This is the central control panel. Open this first Set node and customize it:
  • source: Set to "Meta" to pull from a campaign or "sheets" to read from a Google Sheet.
  • campaign_id: If source is "Meta", enter your Meta Campaign ID here.
  • benchmarks_data: This is critical. Paste your own historical performance data here as a CSV-formatted text block. The template includes an example. For best results, use an export from Ads Manager of your top-performing creatives, including key metrics.
  1. Google Sheets Nodes: There are three Google Sheets nodes that write data. You need to configure all of them to point to the same spreadsheet and sheet.
  • Ad metrics (for raw metrics): Select your spreadsheet and sheet. Ensure "Operation" is set to Append or Update.
  • Ad data from OpenAI (for OpenAI results): Select the same spreadsheet/sheet. Set "Operation" to Update.
  • Ad data from Gemini (for Gemini results): Select the same spreadsheet/sheet. Set "Operation" to Update.
  • Make sure your sheet has columns for all the data fields, e.g., AdID, FileName, spend, impressions, evaluation, summary, recommendation, evaluation G, summary G, etc.
  1. Activate the Workflow: Set your desired frequency in the Schedule Trigger node. Save and activate the workflow.

Further Ideas & Customization

This powerful analysis engine can be extended even further:

  • Add a "Decision" Node: After the AI analyses are logged, add a final step that compares their recommendations. If both AIs say "scale", automatically increase the ad's budget via the Meta Ads API.
  • Create Summary Reports: Add a branch that, after all ads are processed, calculates an overall summary (e.g., "3 creatives recommended for scaling, 5 for stopping") and sends it to a Slack channel.
  • Dynamic Benchmarks: Instead of pasting benchmarks into the Set node, create a step that reads them from a dedicated "Benchmarks" tab in your Google Sheet, making them even easier to update.
  • Experiment with Prompts and Benchmarks: The quality of the AI analysis is highly dependent on the quality of your input. Don't be afraid to: -- Refine the prompts in the AI Agent and Message a model nodes to better match your specific business context and KPIs. -- Curate your benchmarks_data. Test different sets of benchmark data (e.g., "last 30 days top performers" vs. "all-time best") to see how it influences the AI's recommendations. Finding the right combination of prompt and data is key to unlocking the most effective insights.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - Get Ads

Type / Role
n8n-nodes-base.facebookGraphApi - facebookGraphApi
Config choices
Version 1

Block 3 - Get Insights

Type / Role
n8n-nodes-base.facebookGraphApi - facebookGraphApi
Config choices
Version 1

Block 4 - Ads Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 5 - Insights Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 6 - Set Metrics

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Set parameters

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 9 - Get Ad Details

Type / Role
n8n-nodes-base.facebookGraphApi - facebookGraphApi
Config choices
Version 1

Block 10 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 11 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 12 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 13 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 14 - Prepare CSV for OpenAI

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Prepare CSV for Gemini

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Ad data from Gemini

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 17 - Ad data from OpenAI

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 18 - Send data to 4.1-NANO

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 19 - Send data to Gemini

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.1

Block 20 - Ad metrics

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 21 - Get Ads from Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 22 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 25 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Meta Ads Performance Analysis with GPT-4 & Gemini AI Comparisons
Complexity advanced
Nodes 25
Categories Market Research, AI Summarization
Author Kirill Khatkevich
Published 28 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6545/6545.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Meta Ads Performance Analysis with GPT-4 & Gemini AI Comparisons do?

This workflow transforms raw Meta Ads data into actionable, expert level insights. It acts as a virtual performance marketer, analyzing each creative's performance, comparing it against your histor...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Market Research, AI Summarization use case.