var report = AdWordsApp.report(
'SELECT Id, Criteria, CpcBid, FirstPageCpc, FirstPositionCpc, TopOfPageCpc, Criteria ' +
'FROM KEYWORDS_PERFORMANCE_REPORT ' +
'WHERE' +
'Id = 14317961 ' +
'DURING LAST_7_DAYS ');
var rows = report.rows();
while(rows.hasNext()) {
var row = rows.next();
var keywordIdReport = row['Id'];
var keywordNameReport = row['Criteria'];
var cpcBid = row['CpcBid'];
var firstPageCpc = row['FirstPageCpc'];
var firstPositionCpc = row['FirstPositionCpc'];
var topOfPageCpc = row['TopOfPageCpc'];
Logger.log('KeywordIdReport :' + keywordIdReport)
Logger.log('CPCbid :' + cpcBid)
Logger.log('firstPositionCpc : ' + firstPositionCpc)
Logger.log('topOfPageCpc : ' + topOfPageCpc)
Logger.log('firstPageCpc : ' + firstPageCpc)
}
我不明白为什么,但Adwords IDE告诉我,我的查询中的条件WHERE Id = 14317961
无效,但我无法解释它是错误的。这里假设当前Id存在。该查询的目的是访问特定关键字ID的三个字段firstPositionCpc
,topOfPageCpc
和firstPageCpc
。我怎么能解决我的问题?
答案 0 :(得分:4)
尝试在where子句'WHERE ' +
之后给出一个空格。
答案 1 :(得分:1)
'WHERE' +
在'WHERE ' +
之后添加一个空格。
答案 2 :(得分:1)
&#34>之后缺少空间在哪里"
var report = AdWordsApp.report(
'SELECT Id, Criteria, CpcBid, FirstPageCpc, FirstPositionCpc, TopOfPageCpc, Criteria ' +
'FROM KEYWORDS_PERFORMANCE_REPORT ' +
'WHERE ' + <----- space was missing
'Id = 14317961 ' +
'DURING LAST_7_DAYS ');
答案 3 :(得分:1)
在您的查询中,'where'和'ID'之间没有空格,请在这些空格之间添加空格。
'WHERE ' +
'Id = 14317961 ' +
答案 4 :(得分:0)
您只是错过WHERE
关键字后的空格,它应如下所示:
var report = AdWordsApp.report(
'SELECT Id, Criteria, CpcBid, FirstPageCpc, FirstPositionCpc, TopOfPageCpc, Criteria ' +
'FROM KEYWORDS_PERFORMANCE_REPORT ' +
'WHERE ' +
'Id = 14317961 ' +
'DURING LAST_7_DAYS ');