Find ads without RSA or ETA - in a large MCC account without timing out

Skip to first unread message

Jan 11, 2022, 1:35:17 PMJan 11
to Google Ads Scripts Forum
I'm trying to run an MCC script that pulls ad group details to a sheet if an ad group is enabled, campaign is enabled, and the ad group is missing an RSA or ETA ad. Our MCC has over 2,000 accounts, and the below script, which I made some edits to after finding it on Optimization Up by Ahmed Ali, is timing out after going through only 31 accounts. Ahmed Ali's script used var accountIterator = MccApp.accounts().executeInParallel('ETA'); but I received an error message “Selector was too large. Cannot call executeInParallel on a selector with more than 50 elements." so I took out the executeinParallel part. I'd like for a script to be able to get through all 2000 accounts, or if I have to break up the MCC into batches using a label, would prefer to have the script run through at least 500 active accounts before timing out. Is there something in the below version of the script that is inefficent? The last edit I made to try to speed it up was adding   .withCondition("Clicks = 0").forDateRange("THIS_MONTH") to the ad group selector, since these ad groups we're wanting to identify won't have any clicks, as they're missing ad copy.

Thanks in advance for your help!

Below script is adapted from-
ETA Checker
Created by Ahmed Ali,
MCC Version 1.0

var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getActiveSheet();

function main() {

 sheet.getRange("A1").setValue("Account ID");
 sheet.getRange("B1").setValue("Account Name");
 sheet.getRange("D1").setValue("Ad groups");
 sheet.getRange("E1").setValue("ETA Count");
 sheet.getRange("F1").setValue("RSA Count");
 sheet.getRange("G1").setValue("Campaign ID");
 sheet.getRange("H1").setValue("Ad Group ID");

var accountIterator =
          AdsManagerApp.accounts().withCondition("Clicks > 0")
         .orderBy("Clicks DESC")
      while (accountIterator.hasNext()) {
        var account =;;
        Logger.log(account.getName() + ", " + account.getCustomerId());

function ETA() {
  var GetAdGroups = AdWordsApp.adGroups()
 .withCondition('Status = ENABLED')
  .withCondition("Clicks = 0").forDateRange("THIS_MONTH")
 .withCondition("AdvertisingChannelType = SEARCH")
  .withCondition("AdGroupName DOES_NOT_CONTAIN_IGNORE_CASE 'dynamic'")
 .withCondition('CampaignStatus = ENABLED')

 for (var row = 2; GetAdGroups.hasNext(); row ++) {
var AdGroups =;
 var RSAadCount ='Type=RESPONSIVE_SEARCH_AD').withCondition('Status = ENABLED').get().totalNumEntities();
 var ETACount ='Type=EXPANDED_TEXT_AD').withCondition('Status = ENABLED').get().totalNumEntities();
if ((RSAadCount + ETACount < 1)) {
 sheet.appendRow( [AdWordsApp.currentAccount().getCustomerId(),AdWordsApp.currentAccount().getName(), AdGroups.getCampaign().getName(), AdGroups.getName(), ETACount ,RSAadCount, AdGroups.getCampaign().getId(), AdGroups.getId()] );

Google Ads Scripts Forum Advisor

Jan 12, 2022, 2:41:16 AMJan 12

Thank you for reaching out to us.

With regard to your concern, I'm afraid that the Google Ads Scripts is not designed to iterates to a huge amount of accounts in which the limitation document state it as well that you can only process up to 50 accounts. With that in mind, we would recommend to create multiple copy of the script, then lessen the number of each iterations.  Also, you might consider using Google Ads API instead which is more suitable to your use case.

Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team

Reply all
Reply to author
0 new messages