Google Ads Scripts Forum Advisor Prod
unread,Aug 21, 2019, 3:15:01 PM8/21/19Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to adwords-scripts+apn2wqfctjdoumhx...@googlegroups.com, adwords-scripts+apn2wqfctjdoumhx...@googlegroups.co, adwords...@googlegroups.com
Hi Avnish,
To retrieve all keywords that belong to search campaigns, you will have to go through a campaign iterator first, using the
AdvertisingChannelType attribute. For example,
function main() {
var searchCampaigns = AdsApp.campaigns().withCondition("AdvertisingChannelType = 'SEARCH'").get();
while(searchCampaigns.hasNext()) {
var keywords = AdsApp.keywords().withCondition("Status = ENABLED").forDateRange("YESTERDAY").orderBy("Impressions DESC").get();
while(keywords.hasNext()) {
// do work here
}
}
}
Regards,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5001UHEE7D:ref