var ads = AdWordsApp.ads()
.withCondition("CreativeFinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.adsLabel + "']")
.get();var ads = AdWordsApp.ads()
.withCondition("CreativeFinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.adsLabel + "']")
.withCondition("CampaignStatus = ENABLED")
.get();
var keywords = AdWordsApp.keywords()
.withCondition("FinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.keywordsLabel +
"']")
.get();var keywords = AdWordsApp.keywords()
.withCondition("FinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.keywordsLabel +
"']")
.withCondition("CampaignStatus = ENABLED")
.get(); //For Ad Level Urls
AdWordsApp.ads()
.withCondition("LabelNames CONTAINS_NONE['" + settings.adsLabel + "']")
.withCondition("Status = 'ENABLED'")
.withCondition("AdGroupStatus = 'ENABLED'")
.withCondition("CampaignStatus = 'ENABLED'")
.get(),
//For Keyword Level Urls
AdWordsApp.keywords()
.withCondition("FinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.keywordsLabel + "']")
.withCondition("Status = 'ENABLED'")
.withCondition("AdGroupStatus = 'ENABLED'")
.withCondition("CampaignStatus = 'ENABLED'")
.get()
// Check if the campaign has ended and ignore if it has
var endDate = entity.getCampaign().getEndDate();
if(endDate != null && TODAY.year > endDate.year && TODAY.month > endDate.month && TODAY.day > endDate.day) { continue; }
var TODAY = (function () { // Needed so as to check for campaigns that have ended and thus to be ignored.
var d = new Date();
return { year: d.getFullYear(), month: d.getMonth() + 1, day: d.getDate()}
})();