Back to Templates

Generate AI Facebook Ad Variants from Competitors using Apify, GPT-4 & Google Drive

Created by

Created by: Electrabot || vansh404

Electrabot

Last update

Last update 8 hours ago

Share


PPC Thievery: AI-Powered Ad Creative Generation

Overview

The "PPC Thievery" workflow is a sophisticated tool designed to help you analyze high-performing Facebook image ads and generate new, "spun" creative variations. It automatically scrapes active image ads, analyzes them using AI, creates new design prompts based on your desired changes, and then generates fresh image ad creatives. All original and spun assets, along with their metadata, are neatly organized in Google Drive and logged in a Google Sheet for easy tracking.

Use Case

This workflow is perfect for:

  • Performance Marketers: Quickly generate new ad creative variations for A/B testing.
  • Advertising Agencies: Efficiently produce a high volume of diverse ad creatives for clients.
  • Creative Teams: Overcome creative blocks by leveraging AI to spin existing successful ad concepts.
  • Competitive Analysis: Understand what makes competitor ads successful and create your own enhanced versions.

How It Works

  1. Initial Setup (Run Once):
    • The workflow starts by creating a dedicated "PPC Thievery" parent folder in Google Drive and a Google Sheet database (named "PPC Thievery" with a "scraped_ads" sheet). This provides the essential storage and tracking infrastructure.
    • Important: After this initial run, you'll need to update the "Set Variables" node with the generated googleDriveFolderId and spreadsheetId to ensure all subsequent data is saved correctly.
  2. Scrape & Filter Ads:
    • The workflow uses an Apify Facebook Ad Library Scraper to fetch active image ads. You can configure the search query (e.g., "agency") and the number of ads to retrieve.
    • It then filters these ads to focus only on those containing an original_image_url, ensuring you work with visual creatives.
  3. Organize Assets: For each selected ad, the workflow automatically creates a structured folder system in your Google Drive:
    • A main folder named after the ad_archive_id.
    • Subfolders for "1. Source Assets" (for the original ad creative) and "2. Spun Assets" (for the AI-generated variations).
  4. Analyze & Spin Prompts:
    • The original image ad is downloaded and uploaded to your Google Drive within its "Source Assets" folder.
    • OpenAI analyzes the original image, providing an extremely comprehensive description of its content.
    • An AI "Spin Prompts" node takes this detailed image description and a "change request" you define (e.g., change color scheme, replace text, add a logo). It then generates multiple unique "spun" prompts, ready for AI image generation, while adhering to rules like maintaining original asset placement and adapting text for an "AI automation" audience.
  5. Generate New Creatives:
    • For each "spun prompt," GPT Image 1 generates a new image ad creative. These images incorporate your requested changes while retaining the core layout of the original.
    • The newly generated images are saved to your Google Drive within the "Spun Assets" folder for that specific ad.
  6. Log to Google Sheet: Finally, all relevant data for each ad – including the original ad details, the spun prompts used, and links to the source and generated image assets in Google Drive – is appended to your "scraped_ads" Google Sheet.

How to Set It Up

Here's how to get this workflow up and running:

  1. Initial Run & Variable Setup:
    • Run the workflow once by clicking "When clicking ‘Execute workflow’".
    • After this first run, go to your Google Drive and Google Sheets to find the newly created "PPC Thievery" folder and "PPC Thievery" spreadsheet.
    • Copy their respective IDs.
    • In the "Set Variables" node, paste these IDs into the googleDriveFolderId and spreadsheetId fields.
  2. API Keys & Credentials:
    • Apify API Key: Replace YOUR_API_KEY in the "Run Ad Library Scraper" node's URL with your actual Apify API key.
    • Google Drive Account: Ensure your Google Drive credentials are set up and connected to all Google Drive nodes.
    • OpenAI API Key: Ensure your OpenAI API key is configured and linked to the "OpenAI" and "Spin Prompts" nodes.
  3. Define Your Ad Scrape:
    • In the "Run Ad Library Scraper" node, modify the q parameter in the jsonBody to specify the keyword you want to search for in the Facebook Ad Library (e.g., \"ai automation\"). Adjust count and period as desired.
  4. Customize Your Spins:
    • In the "Set Variables" node, modify the changeRequest field. This is where you tell the AI how to "spin" or redesign the ads. Be specific about desired colors, text changes (e.g., "Upgrade your systems today"), font styles, and branding (e.g., "LeftClick logo with a mouse pointer icon").
  5. Test and Automate:
    • Once all settings are complete, you can run the workflow manually to test it.
    • To automate, replace the "When clicking ‘Execute workflow’" trigger with a Schedule Trigger to run periodically (e.g., daily or weekly).

Get ready to revolutionize your ad creative process with AI!