I'm trying to pull spend data from my Google Ads campaigns into a Google Sheet using Google Apps Script. Everything works fine for most campaigns, but I'm getting the error "No campaign found with [Campaign ID]" when trying to pull data for Performance Max campaigns.
Here's a snippet of the code I’m using:
var campaignIterator = AdsApp.campaigns()Some additional details:
Has anyone run into this issue before, or can anyone suggest a fix? I’ve already confirmed that the campaigns exist and are active in Google Ads. Could this be something specific to Performance Max campaigns, or am I missing something in the API request?
Would appreciate any help or suggestions!
Thanks in advance!
Hi,
Thank you for reaching out to the Google Ads Scripts support team.
I would like to inform you that the Performance Max campaigns have separate methods to iterate by using the Google Ads Scripts. The default method “AdsApp.campaigns()” does not iterate through PMax campaigns. To work on PMax campaigns, I would recommend that you use the “AdsApp.performanceMaxCampaigns()” method.
For more information, I would suggest that you go through the documents “AdsApp.PerformanceMaxCampaignSelector” and “AdsApp.PerformanceMaxCampaignIterator”.
I hope this helps. Feel free to reach out to us if you still face any issues.
![]() |
Google Ads Scripts Team |