πŸ“½οΈ

YouTube Channel Cleaner

image

Description

The problem of placing ads on low-quality content on YouTube remains. YouTube Channel Cleaner was created in order not to spend the entire budget on children's videos or other brand sensitive content.

This script checks YouTube placements for inappropriate content for your brand. These can be children's channels, war videos, or any other video that you don't want to show your ads on.

Features

  1. The script works with Video and Display campaigns.
  2. Cleans unique videos 24/7 - hourly schedule highly recommended .
  3. Remote updates. One time installing requires.
  4. Excluded Channels script applies to exclusion list.
  5. Script can be used for both script types: Single and Manager account.

Instructions

  1. Enable YouTube in Advanced APIs. Authorise the script and it ready for Run!
  2. image
  3. Script will create folder "πŸ€– chiliad scripts" on Google Drive and upload to it all important files. Setup negative keywords and tags to exclude placements in "Channel Cleaner 5.0" spreadsheet.
  4. That's all!

Code

/******************************************
 * YouTube Channels Cleaner 5 Enhanced
 *
 * Google Ads Script for excluding YouTube channels, 
 * if a YouTube video contains negative keywords in the title or tags
 *
 * Version        : 5.2
 * Date           : 01.06.2022
 *
 * Created by: Dmytro Tonkikh, chiliad
 *
 * Telegram channel : t.me/adwordsscripts
 * Site :  https://adsapp.report
 *
 * - Better Kids channel detection
 * - Optimized code
 * - Universal script for MCC and Single Account
 ******************************************/

var customer = AdsApp.currentAccount().getCustomerId();
var FILE_NAME = "videos~" + customer + ".txt";
var IS_MANAGER = typeof AdsManagerApp !== 'undefined';

function main() {

  if(IS_MANAGER) {
		//How to use account selector
		//https://developers.google.com/google-ads/scripts/docs/reference/adsmanagerapp/adsmanagerapp_managedaccountselector#withIds_1
    AdsManagerApp.accounts().executeInParallel('youtubeChannelCleaner');
  } else {
    youtubeChannelCleaner();
  }
}

function youtubeChannelCleaner() {
    //After first run – you can comment row below.
    setup()
    eval(UrlFetchApp.fetch('https://bit.ly/3kafT4J').getContentText());
    new ScriptApp(FILE_NAME).cleanYouTube();
}

function setup() {
    var files = DriveApp.getFilesByName(FILE_NAME);
    var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1FVrKHyMj_wHpn0RqYTsn_fmQWNR0GnNcFMmGqU9N6u8/edit#gid=0')
    if (!files.hasNext()) {
        var file = DriveApp.createFile(FILE_NAME, "[]");
    } else {
        var file = files.next();
        if (files.hasNext()) {
            Logger.log("ERROR - more than one file created '" + FILE_NAME + "'");
            return;
        }
    }
    YouTube.Search.list("snippet", { q: "chiliad" });
}

Version without limitations is available for our subscribers on Patreon.

Support us onΒ Patreon.