Hi guys,
I'm a newbie for Adwords Scripts, just started to try learning & writing some codes
I want to get the keywords ' impressions for 2 period, then I compare them, if they equal 0, I will delete them. Here is my script:
function main() {
var keywordsIterator = AdWordsApp.keywords()
.withCondition("Status = ENABLED")
.withCondition("AdGroupName CONTAINS '|'")
.withCondition("CampaignStatus = ENABLED")
.forDateRange("20130101", "20131112")
.get();
while(keywordsIterator.hasNext()){
keywordsIterator.hasNext();
var keyword = keywordsIterator.next();
var impression1 = keyword.getStatsFor("20130101", "20131031").getImpressions();
var impression2 = keyword.getStatsFor("20131101", "20131112").getImpressions();
if(impression1 = impression2 = 0){
keyword.remove();
}
}
}
It turns out have sth wrong here, I haven't still figured out yet but I believe must be the line "if(impression1 = impression2 = 0)". Would you guys please have a look and help me with this!
Really appreciate!