/******************************************* YouTube Tags Finder ** Created by: Dmytro Tonkikh******************************************/
function main() { // Setup Google Sheet. Spreadsheet must have 2 sheets - Keywords and Results. var spreadsheetUrl = "https://docs.google.com/spreadsheets/d/1RFdl5qjlD881zMJoFoLT9FZfJ10sKzl3IuMx2ji5j2Y/edit#gid=1900924837"; var ss = SpreadsheetApp.openByUrl(spreadsheetUrl); var keywordsSheet = ss.getSheetByName('Keywords'); var resultsSheet = ss.getSheetByName('Results'); var lastRow = keywordsSheet.getLastRow(); resultsSheet.clear(); //Clean all previous results from sheet var range = keywordsSheet.getRange(1, 1, lastRow, 1); //Fetch all keywords from first column var values = range.getValues(); Logger.log(values.length); var tags = []; var videos = []; for(var i = 0; values.length > i; i++) { var query = values[i][0]; var results = YouTube.Search.list('id,snippet', {q: query, maxResults: 50, regionCode: "US", relevanceLanguage: "en-US"}); for (var j in results.items) { var item = results.items[j]; videos.push(item.id.videoId); } } for (var i in videos) { try { var results = YouTube.Videos.list('snippet', {id : videos[i]}); if (results.items[0].snippet !== undefined) { var tagsArray = results.items[0].snippet.tags; if (tagsArray !== undefined) { for (var k in tagsArray) { tags.push([tagsArray[k]]) } } } } catch (e) { Logger.log(e); } } //Write results resultsSheet.getRange(1, 1, tags.length, 1).setValues(tags); }
Hi Lucas,
Ciara here, from the Google Ads Scripts team. Thank you for reaching out.
Upon checking the script YouTube Channels Cleaner, linked below, it appears that it is not migrated to the new script experience. The new script experience is now based on Google Ads API infrastructure which mainly supports GAQL. Just an example, the query SELECT Url FROM URL_PERFORMANCE_REPORT WHERE CampaignName CONTAINS "(Video)" DURING TODAY should now be SELECT detail_placement_view.target_url FROM detail_placement_view WHERE campaign.name REGEXP_MATCH ".*(put filter here).*" AND segments.date DURING TODAY in the new script environment.
You can use these documentations below in migrating the said scripts to the New Script experience:
Moving forward, the second script, Youtube Tag finder, can you provide more context with regards to the error you encountered with the said script? In addition, kindly provide us with your Google Ads CID, the script name of your script on the account, screenshots that shows the error on your end, and a shareable link (guide) of the spreadsheet you are using so we can further investigate.
You may send privately via the reply to author option. If this option is not available on your end, you may send it through our email (googleadsscr...@google.com) instead.
Regards,
|
||||||