Skip to main content

Analyze Meta Ad Library Video Ads with Gemini and store results in Google Sheets

Workflow preview

Workflow preview
100%
Analyze Meta Ad Library Video Ads with Gemini and store results in Google Sheets preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Meta Ads Analyzer This n8n template builds an automated system to scrape, analyze, and extract insights from Meta advertising content. The workflow uses AI to perform deep analysis of video ads and...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.splitinbatches, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.code, n8n-nodes-base.stickynote, n8n-nodes-base.googlesheets, @n8n/n8n-nodes-langchain.agent

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Analyze Meta Ad Library Video Ads with Gemini and store results in Google Sheets
Workflow name
Analyze Meta Ad Library Video Ads with Gemini and store results in Google Sheets

Meta Ads Analyzer

This n8n template builds an automated system to scrape, analyze, and extract insights from Meta advertising content. The workflow uses AI to perform deep analysis of video ads and organize the results in a structured format.

How it works

  • The workflow connects to Facebook's Ad Library to scrape video ads based on a specified page ID.
  • Videos are filtered by reach and processed through Google's Gemini AI to analyze their content.
  • Each video is systematically analyzed for its hook, transcript, advertising format, concept, and narrative structure.
  • Results are processed through an AI agent that structures the data into standardized fields.
  • All analysis is saved to a Google Sheet for easy access and further processing.

How to use Once you've set up your Credentials and configured the output:

  • Configure the Google Sheets connection for data output.
  • Specify the Meta Ad Library URL you want to analyze.
  • Adjust the maximum number of ads to scrape and analyze based on your needs.
  • Click "Test Workflow" to start the analysis process.

Requirements

  • Apify account (for Meta Ad Library scraping)
  • Google Gemini
  • Google Sheets

Customizing this workflow

  • Modify the AI prompts in the Settings node to extract different information from the videos.
  • Adjust the output formats in the AI Agent and Structured Output Parser nodes.
  • Change the Google Sheets mapping to match your desired output structure.
  • Increase the number of ads analyzed for more comprehensive research.

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 - When clicking ‘Test workflow’

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

Block 2 - Settings

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

Block 3 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 4 - Google Gemini Chat Model

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

Block 5 - Clean Prompt

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

Block 6 - Sticky Note

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

Block 7 - Sticky Note1

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

Block 8 - Sticky Note2

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

Block 9 - Sticky Note3

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

Block 10 - Store Data

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

Block 11 - Structured Output Parsing Agent

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

Block 12 - Wait for Upload Processing

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 13 - Pass Values for Gemini

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

Block 14 - Upload Video to Gemini

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 15 - Analyze Video with Gemini

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 16 - Download File

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 17 - Change Filetype to Video

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

Block 18 - Scrape Meta Ad Library with Apify

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 19 - Pass relevant Fields

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

Block 20 - Structured Output Parser

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

Block 21 - Calculate Runtime in Days

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

Block 22 - Sort by Reach or Days Running

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

Block 23 - Filter only Video Ads

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

Block 24 - Limit Videos to Analyze

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

3. Summary Table

Workflow Analyze Meta Ad Library Video Ads with Gemini and store results in Google Sheets
Complexity advanced
Nodes 24
Categories Market Research, AI Summarization
Author Daniel Setzermann
Published 03 Mar 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3069/3069.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 Ad Library Video Ads with Gemini and store results in Google Sheets do?

Meta Ads Analyzer This n8n template builds an automated system to scrape, analyze, and extract insights from Meta advertising content. The workflow uses AI to perform deep analysis of video ads and...

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.