Monitor competitor Meta Ads creatives and send alerts with Google Sheets & Telegram
This workflow continuously monitors the Meta Ads Library for new creatives from a specific competitor pages, logs them into Google Sheets, and sends a concise Telegram notification with the number of newly discovered ...
Template notes
This workflow continuously monitors the Meta Ads Library for new creatives from a specific competitor pages, logs them into Google Sheets, and sends a concise Telegram notification 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 Meta 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 id field. - Get lightweight notifications in Telegram 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.
How it Works
The workflow is organized into three logical blocks:
1. Fetch Ads & Handle Pagination - Configuration: The Add parameters Set node stores all key request variables: - adactivestatus (e.g. active), - searchpageids (competitor page IDs), - adreachedcountries, - accesstoken. - Routing: Page or keywords routes execution into one of two HTTP Request nodes: - Facebook Ads API by page — the main branch that queries ads by page ID. - Facebook Ads API by keywords — an optional branch for keyword‑based searches. - Normalization: Facebook Ads API by ... returns the raw adsarchive response. Check the pagination then: - extracts data (array of ad objects) into a dedicated field, - reads paging.next into nexturl for pagination. - Pagination Loop: - If checks whether nexturl is not empty. - Set Next URL assigns nexturl to a generic url field. - Facebook Ads API pagination requests the next page and feeds it back into Check the pagination. This loop continues until there is no nexturl, ensuring all pages of the Ads Library response are processed.
2. De‑duplicate Ads & Log to Google Sheets - Load Existing IDs: - Read existing IDs pulls the existing id column from your Google Sheet (configured to read a specific column/range). - 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 Meta response (data) with the historical existingIds array from Sheets. - Filter New Creatives: - Filter new creatives Code node compares each ad’s id (string) against the existingIds set and builds a new data 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. - Write New Ads: - Split Out expands the filtered data array into individual items (one item per new ad). - Add to sheet then performs an appendOrUpdate into Google Sheets, mapping core fields such as id, adcreationtime, pagename, adcreativebodies, adsnapshoturl, languages, publisherplatforms, and link fields. - The column mapping uses id as the matching column so that existing rows can be updated if needed.
3. Count New Ads & Notify in Telegram - Count: - In parallel with the write step, Split Out 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, Send a text message sends a Telegram message to the configured chatId. - The message includes {{$json.newCount}} and a fixed link to the Google Sheet, giving you a quick heads‑up without listing individual ads.
---