Keyword Performance Report Cost Predicate Not Working

26 views
Skip to first unread message

Ghenadii C.

unread,
Nov 15, 2017, 9:37:23 AM11/15/17
to AdWords Scripts Forum
Hello

I've got a fairly simple script, Generate a report with all the keywords from some campaign, which have a cost greater than some value during some date range. (Using AdWords Scripts)

My Report Definition look like this:

var report = AdWordsApp.report("SELECT AdGroupName, Criteria, Cost " +
                                   "FROM KEYWORDS_PERFORMANCE_REPORT "+
                                   "WHERE CampaignName = \""+campaign.getName()+"\" AND Cost > 60 DURING "+dateRange);

I then export this report to a Spreadsheet, and here is where the problem starts. Upon inspecting the exported report, i find all sorts of keywords with cost less than 60. I have manually checked the number of keyword that satisfy the above condition (Using Adwords UI and filters) and found only 2 of them. The report exported into my spreadsheet contains over 260 keywords. First i thought maybe the Cost > 60 condition is ignored completely but that's not the case (for the number of exported keywords is less than the total in the campaign in question).

More puzzling is the fact that i also tried this:

var keywordIterator = campaign.keywords().withCondition("Cost > 60").forDateRange(from, to).get();
    while(keywordIterator.hasNext()){
      var keyword = keywordIterator.next();
      Logger.log(keyword.getStatsFor(from, to).getCost());
    }

And this returned the 2 keywords that satisfied the conditions in the report definition.

If anyone knows any solution to this problem or why it occurs i would greatly appreciate your help on the matter.

Anthony Madrigal

unread,
Nov 15, 2017, 10:48:15 AM11/15/17
to AdWords Scripts Forum
Hi Ghenadii,

That does seem like odd behavior to me. Can you please reply privately to author your CID and script name so that I can have a look?

Thanks,
Anthony
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages