function pausingAds() {
var ad_iter = AdsApp.ads()
.withCondition("Status = ENABLED")
.withCondition("CombinedApprovalStatus = DISAPPROVED")
.withCondition("CampaignStatus = PAUSED")
.get();
...
}
or for keywords:function pausingKeywords() {
var keyword_iter = AdWordsApp.keywords()
.withCondition("Status = ENABLED")
.withCondition("ApprovalStatus = DISAPPROVED")
.withCondition("CampaignStatus = PAUSED")
.get();
...
}
I see that we have the methods getPolicyApprovalStatus for ads and getApprovalStatus for keywords. But can it also be used as a selector?
|
||||||
function main() {
var adSelector = AdsApp.ads().withCondition('CampaignStatus = ENABLED')
.withCondition("ad_group_criterion.approval_status = ELIGIBLE")
.withCondition('Status = ENABLED')
.withCondition('ApprovalStatus = DISAPPROVED')
var adIterator = adSelector.get();
while (adIterator.hasNext()) {
var ad = adIterator.next();
Logger.log('Delete ads [' + ad.getId() + '] - "' + ad.getHeadline() + '"');
ad.remove();
}
}