Skip to main content

Analyze Meta ads daily with Google Gemini and Google Sheets

Workflow preview

Workflow preview
100%
Analyze Meta ads daily with Google Gemini and Google Sheets preview
Open on n8n.io

1. Workflow Overview

Analyze Meta ads with Gemini and Google Sheets Stop manually exporting CSVs and start automating your marketing insights. This workflow is designed for Marketing Agencies, Freelancers, and Media Bu...

Best for

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

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.gmail, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.chainllm, n8n-nodes-base.googlesheets, n8n-nodes-base.splitout, @n8n/n8n-nodes-langchain.outputparserstructured

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Analyze Meta ads daily with Google Gemini and Google Sheets
Workflow name
Analyze Meta ads daily with Google Gemini and Google Sheets

Analyze Meta ads with Gemini and Google Sheets

Stop manually exporting CSVs and start automating your marketing insights.

This workflow is designed for Marketing Agencies, Freelancers, and Media Buyers who want to keep a daily pulse on their Meta (Facebook/Instagram) Ads performance without logging into Ads Manager.

It doesn't just scrape data; it uses Google Gemini AI to act as a virtual data analyst. It reviews your campaigns, identifies winning/losing creatives, and writes strategic suggestions for both your agency team and your clients.

šŸš€ What this workflow does

  1. Extracts Data: Wakes up every morning (6:00 AM) to fetch yesterday's Ad and Campaign performance from the Facebook Graph API.
  2. Cleans & Filters: Automatically ignores paused or zero-spend campaigns to keep your reports clean.
  3. Structuring: Uses a Code node to group Ads intelligently under their respective Ad Sets and Campaigns.
  4. AI Analysis: Sends the structured data to Google Gemini. The AI analyzes CTR, CPC, and Spend to identify the "Best Performing Ad" and "Worst Performing Ad" per Ad Set.
  5. Reporting:
  • Saves raw Campaign Data to Google Sheets.
  • Saves raw Ad Data to Google Sheets.
  • Saves AI-Generated Insights (Client & Agency suggestions) to a dedicated sheet.
  1. Error Handling: If anything breaks (e.g., API token expiry), it instantly sends you an alert via Gmail with the error details.

šŸ’” Key Features

  • Zero-Spend Filter: Keeps your spreadsheet tidy by excluding inactive ads.
  • Hierarchical Data Processing: Groups data logically so the AI understands the context of your tests.
  • Dual-Perspective Insights: The AI generates two types of advice:
  • For the Client: Simple, performance-based updates.
  • For the Agency: Technical optimization tips (e.g., "Pause Ad B, Scale Ad A").
  • Robust Error Monitoring: Includes a dedicated error workflow to notify you of failures.

šŸ› ļø Prerequisites

To use this template, you will need:

  • Meta/Facebook Developer App: A System User Access Token with ads_read permission.
  • Google Cloud Console Project: Enabled APIs for Google Sheets, Gmail, and Vertex AI (Gemini).
  • Google Sheet: A sheet with three tabs: Campaigns, Ads, and AI_Insights.

šŸ“ Setup Instructions

  1. Configure Credentials: Connect your Facebook Graph API and Google accounts in n8n.
  2. Set Configuration Node: Open the "Set Configuration" node and paste your Ad Account ID and Email Address for error alerts.
  3. Link Google Sheet: Open the three Google Sheets nodes and select your spreadsheet file.
  4. Activate: Turn on the workflow and let it run daily!

Need help setting this up or want a custom automation for your agency? I specialize in building agentic workflows for consultants and agencies.

šŸ“§ Contact me: [email protected]

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 - Template Guide

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

Block 2 - Get Config

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

Block 3 - Send Error Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 4 - Structure Data Hierarchy

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

Block 5 - Write Insights

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

Block 6 - Save AI Insights

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

Block 7 - Save Ad Data

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

Block 8 - Save Campaign Data

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

Block 9 - Set Configuration

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

Block 10 - Split AI Insights

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

Block 11 - Structured Output Parser

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

Block 12 - Google Gemini Chat Model

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

Block 13 - Get Ad Insights - Ad Level

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

Block 14 - Get Ad Insights - Campaign Level

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

Block 15 - Split Ad Data

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

Block 16 - Filter Zero Spend

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

Block 17 - Split Campaign Data

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

Block 18 - Error Trigger

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

Block 19 - Schedule - Once per day

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

Block 20 - Sticky Note1

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

Block 21 - Sticky Note2

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

Block 22 - Sticky Note4

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

Block 23 - Sticky Note5

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

Block 24 - Sticky Note6

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 Analyze Meta ads daily with Google Gemini and Google Sheets
Complexity advanced
Nodes 25
Categories Market Research, AI Summarization
Author Bakdaulet Abdikhan
Published 03 Jan 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/12416/12416.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 Analyze Meta ads daily with Google Gemini and Google Sheets do?

Analyze Meta ads with Gemini and Google Sheets Stop manually exporting CSVs and start automating your marketing insights. This workflow is designed for Marketing Agencies, Freelancers, and Media Bu...

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.