Google Ads provides an opportunity to run your ad campaigns on specific YouTube channels. You can choose to work with the channels that can accumulate the audience interested in your products or services. However, creating a list of suitable channels for such a purpose can be a tedious and time-consuming task.

You can significantly speed this process up just by using one simple script. It will find suitable channels by scanning through your keyword list. The script will provide you with the top 25 YouTube channels per keyword from your list. 

Step 1. Copy this spreadsheet into your Google Drive


Open this spreadsheet using your Google Ads account and create your own copy.

Enter your keywords into the first tab of YOUR spreadsheet.


Step 2. Setting up the script

Go to the Scripts section in your Google Ads account.


Create a new script and copy this code:

function main () {
var spreadsheetUrl = "Your Spreadsheet URL;
var ss = SpreadsheetApp.openByUrl(spreadsheetUrl);
var kwSheet = ss.getSheetByName('Keywords');
var resSheet = ss.getSheetByName('Placements');
var lastRow = kwSheet.getLastRow();
var range = kwSheet.getRange(1, 1, lastRow, 1);
var values = range.getValues();
var placements = [];
for(var i = 0; values.length - 1 > i; i++) {
var query = values[i][0];
var results = YouTube.Search.list('id,snippet', {q: query, maxResults: 25, type: 'channel'});
for (var j in results.items) { var item = results.items[j];
resSheet.getRange(1, 1, placements.length, 2).setValues(placements);

Enable YouTube in Advanced APIs.


Authorize the script.


Click Preview to run the script. The first time you do this, an error will pop up. Do not worry, it's supposed to happen. Switch to the Logs tab to see it.


To fix this, you need to follow the link from the Logs to the Developer Console and enable the API.


Step 3. Get the list of channels

After you enable YouTube Data API, click Preview again. Now the list of channels can be found in the Placements tab of your spreadsheet.


You can check whether these channels suit your needs by clicking the links in the spreadsheet.



Step 4. Ad targeting

Create an ad group in your campaign for the Display Network and select Placements in Content targeting.


Now copy and paste your new list of channels.


You are all set, now you are ready to go and launch your new YouTube Ads campaign. I hope this little piece of code saves you a bunch of time. Have a great conversion rate!

eLama, PPC Marketing Specialist and Brand Evangelist