Google Ads Creative Extraction and CSV Export via SerpAPI - n8n Workflow

Use this comprehensive n8n workflow to efficiently extract Google Ads creatives (text, image, video) for any domain and region using the SerpAPI integration. This n8n template filters results and exports organized CSV files for competitive analysis.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

PPC and SEM Analysts looking for competitive advertising intelligence.
Digital Marketing Professionals needing bulk creative data for analysis.
Data Scientists automating market research data collection.
Users seeking advanced data extraction n8n templates.

Overview

Competitive analysis often requires detailed, structured data about competitor advertising strategies. Manually gathering Google Ads creatives from the Ads Transparency Center is tedious and non-scalable. This n8n workflow provides a robust solution by leveraging the SerpAPI service to programmatically pull all available ad creatives (text, image, and video) for a specific domain and geographical region.

After extraction, the automation uses core logic flow control to filter out irrelevant data and automatically organize the remaining ad items based on their format. This ensures you receive clean, categorized CSV files ready for immediate use, making this a highly valuable n8n template for any competitive research stack. Utilizing a powerful n8n node combination ensures efficiency and accuracy in data handling.

How it Works

The process begins with the manual n8n trigger, designed for quick testing or manual execution.


  1. Define Inputs: The workflow first runs the 'Set Domain & Region' n8n node, where the user defines the target domain and the required geographic region code for the ad search.

  2. API Call: The 'Get Ads Page 1' n8n node executes an HTTP request to SerpAPI, utilizing the Google Ads Transparency Center engine to fetch ad data based on the set inputs and an API key.

  3. Data Filtering: The 'Extract Ad Creatives' function n8n node then processes the raw SerpAPI output. It critically filters the adcreatives array, ensuring that only ads where the targetdomain exactly matches the input domain are retained, providing clean, relevant data for the rest of the n8n workflow.

  4. Format Routing: A 'Split by Format' Switch n8n node checks the format field of each filtered ad (text, image, or video) and routes the item down the corresponding branch.

  5. Export to CSV: Each branch utilizes a dedicated Spreadsheet File n8n node ('Convert Text Ads to CSV', 'Convert Image Ads to CSV', 'Convert Video Ads to CSV1') to convert the data into a CSV file, named dynamically using the domain and format, effectively completing this specialized n8n workflow.

Installation Guide

To install and utilize this n8n template, follow these steps:


  1. Import Workflow: Copy the provided JSON code and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. SerpAPI Credential Setup: Locate the 'Get Ads Page 1' n8n node. You will need to set up a 'Generic Credential' or link an existing SerpAPI credential containing your API key. The API key must be available as an HTTP Query Parameter.

  3. Configure Inputs: Go to the 'Set Domain & Region' n8n node and replace the placeholder values (example.com and exampleregioncode) with your desired target domain and the numeric region code (reference the SerpApi documentation for region codes).

  4. Test: Use the 'When clicking ‘Test workflow’' n8n trigger to run the process and verify that CSV files are generated in your n8n installation's file system (/files/).

Node Details

Detailed n8n Node Breakdown

When clicking ‘Test workflow’ (Manual Trigger n8n trigger):
Function: Starts the n8n workflow manually for development and immediate execution.
Key Configuration: Standard manual n8n trigger.

Set Domain & Region (Set n8n node):
Function: Defines the mandatory input variables (domain and region) used throughout the n8n workflow to query SerpAPI.
Key Configuration: Sets static string values for domain (e.g., mycompetitor.com) and region.

Get Ads Page 1 (HTTP Request n8n node):
Function: Executes the API call to SerpApi using the googleadstransparencycenter engine to fetch ad data.
Key Configuration: URL set to https://serpapi.com/search.json. Query parameters include dynamic data for text (domain) and region. Requires a linked API key credential.

Extract Ad Creatives (Function n8n node):
Function: Executes custom JavaScript to filter the incoming JSON data, retaining only ad creatives whose targetdomain matches the domain requested by the user.
Key Configuration: Contains filtering logic to ensure data relevance.

Split by Format1 (Switch n8n node):
Function: This critical flow control n8n node routes items based on their ad creative format (text, image, or video) into three separate processing branches.
Key Configuration: Uses the expression {{$json["format"]}} and checks for exact equality with 'text', 'image', or 'video'.

Convert [Format] Ads to CSV (Spreadsheet File n8n node - 3 instances):
Function: Converts the received data items into a structured CSV file format.
Key Configuration: Operation is toFile. fileName is dynamically generated, incorporating the ad format and target domain (e.g., /files/text{{ $json.targetdomain }}_ads.csv).

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by
Nikan Noorafkan
Nikan Noorafkan

Hey, I’m Nikan Noorafkan — a creator passionate about building smart, automated workflows that drive business outcomes. With a background in performance marketing, user acquisition, and retention strategies, I use n8n to connect data, automate repetitive tasks, and scale growth across the funnel.

Featured*