YouTube Channel Exclusion Audit And Blocker
Reviews YouTube placements in video campaigns, whitelists acceptable channels in a sheet, and excludes channels that fail your country or topic rules.
Script Code
Use this when you want a stricter YouTube placement-control workflow with spreadsheet whitelisting and email reporting.
Preview is public. Unlock full code with name and email.
/**
* ==========================================================
* YouTube Channel Exclusion Audit And Blocker
* ==========================================================
* Description: Reviews YouTube placements, whitelists good
* channels, and excludes channels that fail your rules.
*
* Copyright (c) 2026 TwoSquares. All Rights Reserved.
* Developed by Kiril Ivanov
*/
function main() {
var SPREADSHEET_URL = "https://docs.google.com/spreadsheets/d/xxxx";
// ... preview shortened
}About This Script
YouTube Channel Exclusion Audit And Blocker is a more advanced placement-control script for video campaigns. It reviews recent YouTube placements, checks channel metadata, whitelists acceptable channels in a sheet, and excludes channels that do not meet your rules.
This updated version cleans up the original draft by fixing variable naming, channel parsing, spreadsheet handling, builder usage, and logging structure. It still relies on the YouTube advanced service, so that dependency must be enabled before use.
Because this script performs direct exclusions based on metadata rules, it should be tested conservatively. The whitelist sheet is important because it lets you preserve channels you have already vetted manually.
Implementation Notes
- Enable the YouTube advanced service before running the script.
- Replace the spreadsheet URL, sheet name, and alert email values.
- Adjust allowed countries, impression range, and topic-category logic for your account.
- Run manually once and confirm the whitelist and exclusion behaviour.
- Only schedule it after you trust the metadata rules and email output.
More Scripts In This Library
Automatic Video Placement Exclusion
Excludes low-view-rate video placements from video campaigns using current GAQL reporting and duplicate-safe batching.
Display Placement Domain Excluder
Excludes display placements that match domain rules and optionally adds them to a shared excluded placement list for broader reuse.
Placement Exclusion Candidate Finder
Finds expensive non-converting placements in Display/Video campaigns to support exclusion decisions.
Account Anomaly Detector
Compares today’s account performance against the same weekday across previous weeks and alerts when impressions, clicks, conversions, or cost move outside expected bounds.
YouTube Channel Exclusion Audit And Blocker FAQs
Common setup, usage, and troubleshooting questions for this script.