Latenode

Automate Facebook ad data extraction and analysis in Google Sheets

This workflow automates the process of extracting Facebook ad data, analyzing the content using AI-powered tools, and storing the resulting insights directly in a Google Sheets spreadsheet.

The system fetches ads from the Facebook Ad Library, processes text, image, and video ads using different AI models, and generates detailed summaries and rewritten ad copies. This solution is designed for PPC agencies and marketers who need strategic intelligence on competitor ads. The workflow integrates with Apify for web scraping, Gemini and OpenAI for content analysis, Google Drive for storage, and Google Sheets for data storage.

Updated Apr 6, 2026Est. run: 26sEst. cost: $0.0703
How Latenode estimates time and cost

Latenode bills workflow runs in credits: 1 credit = 30 seconds of processing. Minimum charge per run depends on your plan. Plug-and-Play (PnP) AI nodes are billed separately—each PnP token is $1 USD, charged pay-as-you-go at vendor cost plus a small processing fee, with no API keys required.

Full pricing — how credits work →
Social media

Workflow preview

What this template does

  • Extracts Facebook ad data from the Ad Library using Apify web scraper
  • Analyzes ad text, images, and videos using OpenAI and Gemini AI models
  • Generates detailed ad insights and rewritten copies in a Google Sheets spreadsheet
  • Stores ad performance data and AI-powered summaries in the Google Sheets
  • Provides competitive intelligence on Facebook ads for PPC agencies and marketers

How it works

1
Trigger

Manually Trigger the Workflow

The workflow is manually triggered to begin the process of extracting, analyzing, and storing Facebook ad data for strategic intelligence.

2
Action

Fetch Facebook Ads from Ad Library

The workflow uses the Facebook integration to scrape ads from the Facebook Ad Library, gathering a set of ads to be processed.

3
Action

Extract Ads Using Apify Web Scraper

The Apify web scraping integration is used to crawl and extract the ads gathered from the Facebook Ad Library.

4
Logic

Filter for High-Engagement Ads

The workflow filters the extracted ads, keeping only those from pages with over 1,000 likes, to focus on high-performing content.

5
Logic

Route Ads by Type

The workflow routes the ads based on their format (video, image, or text), so they can be processed accordingly.

6
Action

Process Video Ads

For each video ad, the workflow downloads the video asset using a headless browser, stores it in Google Drive, and analyzes the content using the Gemini AI integration.

7
Action

Store Video Ad Details

The video ad details and analysis results are added to a Google Sheets spreadsheet.

8
Action

Process Image Ads

For each image ad, the workflow analyzes the image content using the OpenAI integration.

9
Action

Store Image Ad Details

The image ad details and analysis results are added to the Google Sheets spreadsheet.

10
Action

Process Text Ads

For each text ad, the workflow analyzes the text content using the OpenAI integration.

11
Action

Store Text Ad Details

The text ad details and analysis results are added to the Google Sheets spreadsheet.

12
Logic

Wait Before Completing

The workflow pauses for 15 seconds before completing to ensure all data has been processed and stored.

Setup guide

1

Add Apify Credential

1. Go to the Latenode Credentials panel and add a new credential for Apify. 2. Enter your Apify API key and save the credential.

2

Configure Apify Web Scraper Node

1. Add an Apify node to your workflow. 2. Select the Apify credential you created earlier. 3. Configure the Apify node with the necessary inputs, such as the Facebook Ad Library URLs you want to scrape and any limits or settings for the scraping process.

3

Add Google Drive Credential

1. Go to the Latenode Credentials panel and add a new credential for Google Drive. 2. Authorize Latenode to access your Google Drive account and save the credential.

4

Configure Google Drive Node

1. Add a Google Drive node to your workflow. 2. Select the Google Drive credential you created earlier. 3. Configure the Google Drive node to upload files to the desired folder in your Google Drive.

5

Add Gemini Credential

1. Go to the Latenode Credentials panel and add a new credential for Gemini. 2. Enter your Gemini API key and save the credential.

6

Configure Gemini Nodes

1. Add Gemini nodes to your workflow for processing video, image, and text ads. 2. Select the Gemini credential you created earlier. 3. Configure the Gemini nodes with the necessary settings for your ad analysis requirements.

7

Add Google Sheets Credential

1. Go to the Latenode Credentials panel and add a new credential for Google Sheets. 2. Authorize Latenode to access your Google Sheets account and save the credential.

8

Configure Google Sheets Node

1. Add a Google Sheets node to your workflow. 2. Select the Google Sheets credential you created earlier. 3. Configure the Google Sheets node to write the ad data, summaries, and rewritten copies to the desired spreadsheet and sheet.

9

Add OpenAI Credential

1. Go to the Latenode Credentials panel and add a new credential for OpenAI. 2. Enter your OpenAI API key and save the credential.

10

Configure OpenAI Nodes

1. Add OpenAI nodes to your workflow for analyzing text, image, and video ads. 2. Select the OpenAI credential you created earlier. 3. Configure the OpenAI nodes with the necessary settings for your ad analysis requirements.

Requirements

Apify account and API key for web scraping and data extraction
OpenAI API key for text content analysis
Gemini API key for image and video content analysis
Google Drive account and API access for storing processed data

FAQ

Common questions about this template

Each run uses credits on your Latenode plan. We charge for processing time (1 credit = 30 seconds). Your actual cost depends on your plan and how long the run takes. See pricing plans for plans and how credits work.

More templates

You might also like

Browse all templates →
Social media

Automatically like fresh Instagram posts with AI-powered targeting

This Latenode automation template helps social media managers and brands maintain an active and engaged presence on Instagram by automatically liking fresh posts on selected hashtags. The workflow uses a rotating set of Instagram session cookies, AI-powered hashtag generation, and Phantombuster web scraping to streamline the process, reducing the need for manual intervention. The scheduled trigger runs every 2 hours, selecting a random cookie and generating relevant hashtags to target new posts, then automatically liking them. The solution integrates with Instagram, Phantombuster, Microsoft SharePoint, and OpenAI to provide a comprehensive automation experience.

26s$0.0703
Social media

Automate your sales outreach with Apify, GPT-4o, and WhatsApp

This automated workflow streamlines the sales cold calling process by integrating web scraping, natural language processing, and WhatsApp messaging. It leverages Apify to extract lead data from social media and web sources, generates personalized sales scripts using GPT-4o, and sends automated outreach messages via WhatsApp to connect with potential customers. The workflow is designed for sales teams looking to optimize their cold calling pipeline and increase productivity by automating repetitive tasks.

26s$0.0703
Social media

Automatically sync LinkedIn lead gen form data to Google Sheets

This automation solution is designed to help marketers and sales teams efficiently capture and track new lead generation form responses from LinkedIn Ads. The automation will automatically transfer the lead details, such as name, email, and other relevant information, into a centralized Google Sheets spreadsheet. This provides a unified view of all incoming leads, allowing for better organization, analysis, and follow-up. By streamlining the lead capture process, users can focus on nurturing and converting these potential customers, rather than manually managing multiple data sources.

25s$0