Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Unable to Pause Ad Groups Using Script Despite Valid IDs and Active Campaigns

36 views
Skip to first unread message
Message has been deleted

Mukhlis Sholihin

unread,
Jan 26, 2025, 7:15:18 PMJan 26
to Google Ads Scripts Forum

Hi guys,

I am currently facing an issue with a Google Ads script that is intended to pause specific Ad Groups using their IDs. Although I have validated that the Ad Group IDs are correct and belong to active campaigns, the script does not seem to make any changes, and the logs display the following message:

"No Ad Groups found with the provided IDs."

Here are the key details:

  • Ad Group IDs: '12345' & '6789'
Script
function main() {
  var adGroupIds = ['12345, '6789'];
  var adGroups = AdsApp.adGroups().withIds(adGroupIds).get();

  if (!adGroups.hasNext()) {
    Logger.log('No Ad Groups found with the provided IDs.');
    return;
  }

  while (adGroups.hasNext()) {
    var adGroup = adGroups.next();
    adGroup.pause();
    Logger.log('Paused Ad Group: ' + adGroup.getName() + ' (ID: ' + adGroup.getId() + ')');
  }
}

Google Ads Scripts Forum Advisor

unread,
Jan 27, 2025, 12:29:41 AMJan 27
to adwords...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads Scripts Support team.

Please be informed that I have removed your response from the forums as it contains the PII information.

The provided ad group IDs (162732006897 and 162732005497) are associated with the App campaign type. This is why the script logs the message, "No Ad Groups found with the provided IDs." Currently, the campaign selector (AdsApp.campaigns()) only retrieves Search and Display campaigns. Please note that App campaigns are not yet supported in Google Ads Scripts. I recommend following the blog post for further updates on this feature.

I hope this helps! 
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGyVf:ref" (ADR-00285940)

Thanks,
 
Google Logo Google Ads Scripts Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



Reply all
Reply to author
Forward
0 new messages