Smart Campaign With Google Ads Scripts

59 views
Skip to first unread message

Rimijara Mina

unread,
Apr 1, 2025, 4:30:42 AM4/1/25
to Google Ads Scripts Forum
Hello,

I need to use google ads scripts to manipulate smart campaigns, get data, set budgets, adjust landing page links, tweak banners, adjust keywords, etc. But I can't seem to get the smart campaigns using the script, only the search campaigns. Please teach me how the script can get and operate the smart campaigns.

I have tried the scripts like this:
AdsApp.campaigns().get();
and like this:
AdsApp.search('SELECT campaign.name,campaign.advertising_channel_type FROM campaign');

Thank you for your assistance.

Nils Rooijmans

unread,
Apr 2, 2025, 2:47:03 AM4/2/25
to Google Ads Scripts Forum
Unfortunately, only search and display campaigns are supported in the standard campaign selector.

Google Ads Scripts provides separate methods and classes for accessing other campaign types, like Performance Max . 

Foer example: Retrieve Performance Max Campaigns

Step-by-Step Breakdown

Define the Selector for Performance Max Campaigns:
  Use the AdsApp.performanceMaxCampaigns() method to get the campaign selector.
  Apply the necessary filters to select only enabled Performance Max campaigns.
Create the Iterator:
  Use the get() method to fetch the iterator.
  Loop through the results in the iterator using the hasNext() and next() methods.
   Log the Campaign Details:
  Extract the campaign name and ID for each campaign and log them.

More details and the code:

Hope this helps,

Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/
Reply all
Reply to author
Forward
0 new messages