Back to Catalog

Templates by Kirill Khatkevich

Meta Ads Performance Analysis with GPT-4 & Gemini AI Comparisons

This workflow transforms raw Meta Ads data into actionable, expert-level insights. It acts as a virtual performance marketer, analyzing each creative's performance, comparing it against your historical benchmarks, and delivering clear recommendations on whether to scale, optimize, or stop the ad. By running parallel analyses with both OpenAI and Gemini, it provides a unique, dual-perspective evaluation. This template is the perfect sequel to our "Automation of Creative Testing" workflow but also works powerfully on its own. Use Case Manually sifting through ads manager reports is tedious, and identifying true winners from early data is challenging. This workflow solves these problems by automating the entire analysis pipeline. It's designed for performance marketing teams who need to: Make faster, data-driven decisions on which creatives to scale. Get objective, AI-powered second opinions on ad performance. Systematically evaluate creatives against consistent, pre-defined benchmarks. Maintain a central log in Google Sheets with both raw metrics and qualitative AI analysis. Save hours spent on manual data crunching and report generation. How it Works The workflow is structured into three logical stages: Configuration & Data Ingestion: A central ⚙️ Set parameters node holds all key variables: the data source (Meta or Sheets), campaign_id, and, most importantly, your historical performance benchmarks as a simple text block. An IF node directs the workflow to fetch data either directly from a Meta Ads campaign or from a specified Google Sheet (ideal for analyzing a curated list of ads). Data Processing & AI Analysis (Parallel Execution): After fetching raw performance data (spend, impressions, clicks, actions), the workflow splits into three parallel branches for maximum resilience: Branch 1 (Data Logging): Immediately writes or updates a row in Google Sheets with the raw metrics for the creative. This ensures no data is lost, even if the AI analysis fails. Branch 2 (OpenAI Analysis): Prepares a CSV string of the creative's data, sends it along with the benchmarks to an OpenAI model (e.g., GPT-4), and instructs it to return a structured JSON analysis. Branch 3 (Gemini Analysis): Performs the exact same process but using Google's Gemini model via a LangChain agent, providing a second, independent evaluation. Results Aggregation: The results from both AI models are received as structured JSON. Two final Google Sheets nodes take these results and update the original row (matching by AdID), adding the evaluation, significance, summary, and recommendation into separate columns. The final sheet contains a complete picture: raw data side-by-side with analyses from two different AIs. --- Setup Instructions Credentials: 1.1 Connect your Meta Ads account. 1.2 Connect your Google account (for Sheets). 1.3 Connect your OpenAI account. 1.4 Connect your Google Gemini (Palm) account. The ⚙️ Set parameters Node: This is the central control panel. Open this first Set node and customize it: source: Set to "Meta" to pull from a campaign or "sheets" to read from a Google Sheet. campaign_id: If source is "Meta", enter your Meta Campaign ID here. benchmarks_data: This is critical. Paste your own historical performance data here as a CSV-formatted text block. The template includes an example. For best results, use an export from Ads Manager of your top-performing creatives, including key metrics. Google Sheets Nodes: There are three Google Sheets nodes that write data. You need to configure all of them to point to the same spreadsheet and sheet. Ad metrics (for raw metrics): Select your spreadsheet and sheet. Ensure "Operation" is set to Append or Update. Ad data from OpenAI (for OpenAI results): Select the same spreadsheet/sheet. Set "Operation" to Update. Ad data from Gemini (for Gemini results): Select the same spreadsheet/sheet. Set "Operation" to Update. Make sure your sheet has columns for all the data fields, e.g., AdID, FileName, spend, impressions, evaluation, summary, recommendation, evaluation G, summary G, etc. Activate the Workflow: Set your desired frequency in the Schedule Trigger node. Save and activate the workflow. --- Further Ideas & Customization This powerful analysis engine can be extended even further: Add a "Decision" Node: After the AI analyses are logged, add a final step that compares their recommendations. If both AIs say "scale", automatically increase the ad's budget via the Meta Ads API. Create Summary Reports: Add a branch that, after all ads are processed, calculates an overall summary (e.g., "3 creatives recommended for scaling, 5 for stopping") and sends it to a Slack channel. Dynamic Benchmarks: Instead of pasting benchmarks into the Set node, create a step that reads them from a dedicated "Benchmarks" tab in your Google Sheet, making them even easier to update. Experiment with Prompts and Benchmarks: The quality of the AI analysis is highly dependent on the quality of your input. Don't be afraid to: -- Refine the prompts in the AI Agent and Message a model nodes to better match your specific business context and KPIs. -- Curate your benchmarks_data. Test different sets of benchmark data (e.g., "last 30 days top performers" vs. "all-time best") to see how it influences the AI's recommendations. Finding the right combination of prompt and data is key to unlocking the most effective insights.

Kirill KhatkevichBy Kirill Khatkevich
2304

Analyze Meta ads creatives with Google Vision & Video Intelligence APIs

This workflow transforms your Meta Ads creatives into a rich dataset of actionable insights. It's designed for data-driven marketers, performance agencies, and analysts who want to move beyond basic metrics and understand the specific visual and textual elements that drive ad performance. By automatically analyzing every video and image with Google's powerful AI (Video Intelligence and Vision APIs), it systematically deconstructs your creatives into labeled data, ready for correlation with campaign results. Use Case You know some ads perform better than others, but do you know why? Is it the presence of a person, a specific object, the on-screen text, or the spoken words in a video? Answering these questions manually is nearly impossible at scale. This workflow automates the deep analysis process, allowing you to: Automate Creative Analysis: Stop guessing and start making data-backed decisions about your creative strategy. Uncover Hidden Performance Drivers: Identify which objects, themes, text, or spoken phrases correlate with higher engagement and conversions. Build a Structured Creative Database: Create a detailed, searchable log of every element within your ads for long-term analysis and trend-spotting. Save Countless Hours: Eliminate the tedious manual process of watching, tagging, and logging creative assets. How it Works The workflow is triggered on a schedule and follows a clear, structured path: Configuration & Ad Ingestion: The workflow begins on a schedule (e.g., weekly on Monday at 10 AM). It starts by fetching all active ads from a specific Meta Ads Campaign, which you define in the Set Campaign ID node. Intelligent Branching (Video vs. Image): An IF node inspects each creative to determine its type. Video creatives are routed to the Google Video Intelligence API pipeline. Image creatives are routed to the Google Vision API pipeline. The Video Analysis Pipeline: For each video, the workflow gets a direct source URL, downloads the file, and converts it to a Base64 string. It then initiates an asynchronous analysis job in the Google Video Intelligence API, requesting LABELDETECTION, SPEECHTRANSCRIPTION, and TEXT_DETECTION. A loop with a wait timer periodically checks the job status until the analysis is complete. Finally, a Code node parses the complex JSON response, structuring the annotations (like detected objects with timestamps or full speech transcripts) into clean rows. The Image Analysis Pipeline: For each image, the file is downloaded, converted to Base64, and sent to the Google Vision API. It requests a wide range of features, including label, text, logo, and object detection. A Code node parses the response and formats the annotations into a standardized structure. Data Logging & Robust Error Handling: All successfully analyzed data from both pipelines is appended to a primary Google Sheet. The workflow is built to be resilient. If an error occurs (e.g., a video fails to be processed by the API, or an image URL is missing), a detailed error report is logged to a separate errors sheet in your Google Sheet, ensuring no data is lost and problems are easy to track. --- Setup Instructions To use this template, you need to configure a few key nodes. Credentials: Connect your Meta Ads account. Connect your Google account. This account needs access to Google Sheets and must have the Google Cloud Vision API and Google Cloud Video Intelligence API enabled in your GCP project. The Set Campaign ID Node: This is the primary configuration step. Open this Set node and replace the placeholder value with the ID of the Meta Ads campaign you want to analyze. Google Sheets Nodes: You need to configure two Google Sheets nodes: Add Segments data: Select your spreadsheet and the specific sheet where you want to save the successful analysis results. Ensure your sheet has the following headers: campaignid, adid, creativeid, videoid, filename, imageurl, source, annotationtype, labelortext, category, fulltranscript, confidence, starttimes, endtimes, languagecode, processedat_utc. Add errors: Select your spreadsheet and the sheet you want to use for logging errors (e.g., a sheet named "errors"). Ensure this sheet has headers like: errortype, errormessage, campaignid, adid, creativeid, filename, processedatutc. Activate the Workflow: Set your desired frequency in the Run Weekly on Monday at 10 AM (Schedule Trigger) node. Save and activate the workflow. --- Further Ideas & Customization This workflow provides the "what" inside your creatives. The next step is to connect it to performance. Build a Performance Analysis Workflow: Create a second workflow that reads this Google Sheet, fetches performance data (spend, clicks, conversions) for each ad_id from the Meta Ads API, and merges the two datasets. This will allow you to see which labels correlate with the best performance. Create Dashboards: Use the structured data in your Google Sheet as a source for a Looker Studio or Tableau dashboard to visualize creative trends. Incorporate Generative AI: Add a final step that sends the combined performance and annotation data to an LLM (like in the example you provided) to automatically generate qualitative summaries and recommendations for each creative. Add Notifications: Use the Slack or Email nodes to send a summary after each run, reporting how many creatives were analyzed and if any errors occurred.

Kirill KhatkevichBy Kirill Khatkevich
1542

Track TikTok Ads Library with Apify, Google Sheets & Slack/Telegram Notifications

This workflow continuously monitors the TikTok Ads Library for new creatives from specific advertisers or keyword searches, scrapes them via Apify, logs them into Google Sheets, and sends concise notifications to Telegram or Slack with the number of newly discovered ads. It is built as a safe, idempotent loop that can run on a schedule without creating duplicates in your sheet. Use Case Manually checking the TikTok Ads Library for competitor creatives is time-consuming, and it's easy to lose track of which ads you've already seen. This workflow is ideal if you want to: Track competitor creatives over time in a structured Google Sheet. Avoid duplicates by matching ads via their unique adId field. Get lightweight notifications in Telegram or Slack that tell you how many new ads appeared, without spamming you with full ad lists. Run the process on autopilot (daily, weekly, etc.) with a single schedule. Monitor by advertiser ID or keywords with flexible search parameters. How it Works The workflow is organized into four logical blocks: Configuration & Date Conversion Configuration: The Set Parameters Set node stores all key request variables: Ad target country (e.g., all or specific ISO country codes), Ad published date From (automatically set to yesterday by default), Ad published To (automatically set to today by default), Advertiser name or keyword (for keyword-based searches), advbizids (advertiser business IDs for specific advertiser tracking), Ad limit (optional limit on the number of results to scrape). Date Conversion: Convert Dates to Unix transforms the human-readable date format (DD/MM/YYYY) into Unix timestamps in milliseconds, which are required by the TikTok Ads Library API. Request Building & Data Fetching Body Construction: Build Apify Body creates the JSON request body for the Apify actor: Builds the TikTok Ads Library URL with all search parameters (region, date range, advertiser name/keyword, advertiser IDs). Conditionally adds resultsLimit to the request body only if the Ad limit field is not empty, allowing you to scrape all results or limit them as needed. Data Fetching: Get TT Ads through Apify executes the Apify actor (Tiktok Ads Scraper) and retrieves all matching ads from the TikTok Ads Library. Data Preparation & De-duplication Data Extraction: Prepare Data for Sheets safely extracts nested data from the API response: Extracts the first video URL from the videos array (if available). Extracts the cover image URL from the first video object. Extracts the TikTok username from the tiktokUser object (if available). Handles cases where arrays are empty or objects are missing without throwing errors. Load Existing IDs: Read existing IDs pulls the existing adId column from your Google Sheet (configured to read a specific column/range, e.g., column K). Collect ID list converts these into a unique, normalized string array existingIds, which represents all ads you have already logged. Attach State: Attach existing ids (Merge node) combines, for each execution, the freshly fetched TikTok response with the historical existingIds array from Sheets. Filter New Creatives: Filter new creatives Code node compares each ad's adId (string) against the existingIds set and builds a new array containing only ads that are not yet present in the sheet. It also protects against duplicates inside the same batch by tracking seen IDs in a local Set. Data Logging & Notification Write New Ads: Append or update row in sheet performs an appendOrUpdate into Google Sheets, mapping core fields such as adId, adName, advertiserName, advertiserId, paidBy, impressions, regionStats, targeting, tiktokUser, startUrl, videos, and coverImageURL (using the =IMAGE() formula to display images directly in the sheet). The column mapping uses adId as the matching column so that existing rows can be updated if needed. Count: In parallel with the write step, Filter new creatives also feeds into Count new ads. This Code node returns a single summary item with newCount = items.length, i.e., the total number of new creatives processed in this run. Guard: Any new ads? checks whether newCount is greater than 0. If not, the workflow ends silently and no message is sent, avoiding noise. Notify: When there are new creatives, both Send a text message (Telegram) and Send a message (Slack) send notifications to the configured channels. The message includes {{$json.newCount}} and a fixed link to the Google Sheet, giving you a quick heads-up without listing individual ads. --- Setup Instructions To use this template, configure the following components. Credentials Apify: Configure the Apify account credentials used by Get TT Ads through Apify. You'll need an Apify account with access to the Tiktok Ads Scraper actor. Google Sheets: Connect your Google account in: Read existing IDs, Append or update row in sheet. Telegram (optional): Connect your Telegram account credentials in Send a text message. Slack (optional): Configure your Slack credentials in Send a message. The Set Parameters Node Open the Set Parameters Set node and customize: Ad target country: Which countries to monitor (all for all countries, or specific ISO 3166 country codes like US, GB, etc.). Ad published date From: Start date for the search range (defaults to yesterday using {{ $now.minus({ days: 1 }).toFormat('dd/MM/yyyy') }}). Ad published To: End date for the search range (defaults to today using {{ $now.toFormat('dd/MM/yyyy') }}). Advertiser name or keyword: Search by advertiser name or keywords (URL-encoded format, e.g., %22Applicave%20LLC%22). advbizids: Specific advertiser business IDs to track (comma-separated if multiple). Ad limit: Optional limit on the number of results (leave empty to scrape all available results). Google Sheets Configuration Read existing IDs Set documentId and sheetName to your tracking spreadsheet and sheet (e.g., Sheet1). Configure the range to read only the column holding the ad adId values (e.g., column K: K:K). Append or update row in sheet Point documentId and sheetName to the same spreadsheet/sheet. Make sure your sheet has the columns expected by the node (e.g., adId, coverImageURL, adName, Impressions, regionStats, targeting, tiktokUser, advertiserID, paidBy, advertiserName, startURL, videos). Confirm that adId is included in matchingColumns so de-duplication works correctly. Notification Configuration Telegram: In Send a text message, set: chatId: Your target Telegram chat or channel ID. text: Customize the message template as needed, but keep {{$json.newCount}} to show the number of new creatives. Slack: In Send a message, set: channelId: Your target Slack channel ID. text: Customize the message template as needed, but keep {{$json.newCount}} to show the number of new creatives. Schedule Open Schedule Trigger and configure when you want the workflow to run (e.g., every morning). Save and activate the workflow. --- Further Ideas & Customization This workflow is a solid foundation for systematic TikTok competitor monitoring. You can extend it to: Track multiple advertisers by turning advbizids into a list and iterating over it with a loop or separate executions. Enrich the log with performance data by creating a second workflow that reads the sheet, pulls engagement metrics (likes, shares, comments) for each logged adId from TikTok's API (if available), and merges the metrics back. Add more notification channels such as email, or send a weekly summary that aggregates new ads by advertiser, format, or country. Tag or categorize creatives (e.g., "video vs image", "country", "language", "advertiser type") directly in the sheet to make later analysis easier. Combine with Meta Ads monitoring by running both workflows in parallel and creating a unified competitor intelligence dashboard. Add image analysis by integrating Google Vision API to automatically detect objects, text, and themes in the cover images, similar to the Meta Ads creative analysis workflow.

Kirill KhatkevichBy Kirill Khatkevich
166
All templates loaded