我写了一个adwords脚本,以暂停属于特定广告组的所有广告(使用特定标签)。
但是当我运行它时,出现错误“无法从AdWords中读取。请稍等一下再试一次。” 由于此行“.withCondition(”LabelNames CONTAINS'TEST'“)”
,因此出现此错误当我删除此行时,代码无任何问题。
var campaignsIterator = AdWordsApp.campaigns()
.withCondition("Name CONTAINS 'SPECIFIC CAMPAIGN'")
.get();
if(!campaignsIterator.hasNext()){
Logger.log("No Campaign");
}else{
while (campaignsIterator.hasNext()) {
var campaign = campaignsIterator.next();
var adGroupIterator = campaign.adGroups()
.withCondition("Name CONTAINS 'SPECIFIC ADGROUP'")
.get();
while (adGroupIterator.hasNext()) {
var adGroup = adGroupIterator.next();
Logger.log("Campaign : " + campaign.getName() + " | AdGroup : " + adGroup.getName());
var adIteratorNormal = adGroup.ads()
.withCondition("LabelNames CONTAINS 'LABEL-TEST'")
.withCondition("Type = TEXT_AD")
.get()
while(adIteratorNormal.hasNext()){
var ads = adIteratorNormal.next();
if(ads.isEnabled()){
ads.pause;
}
}
}
}
}
我想知道如何解决这个问题。 谢谢 帕斯卡
答案 0 :(得分:1)
要解决此问题:将“CONTAINS'LABEL-TEST'”替换为“CONTAINS_ANY ['LABEL-TEST']”
https://groups.google.com/forum/#!topic/adwords-scripts/pqH0i1_YKDo