I'm starting to test the new Google Ads scripts that are in beta, and the sample at
function main() {
let keywords = AdsApp.keywords()
.orderBy("metrics.impressions DESC")
.forDateRange("YESTERDAY")
.withLimit(10)
.get();
console.log("The 10 keywords with the most impressions yesterday:");
while (keywords.hasNext()) {
let keyword = keywords.next();
console.log(`${keyword.getText()}: ${keyword.getStatsFor("YESTERDAY").getImpressions())}`);
}
}
Gives this error:
SyntaxError: Missing } in template expression (line 11)
When I remove the last ) from after .getImpressions() the script works:
function main() {
let keywords = AdsApp.keywords()
.orderBy("metrics.impressions DESC")
.forDateRange("YESTERDAY")
.withLimit(10)
.get();
console.log("The 10 keywords with the most impressions yesterday:");
while (keywords.hasNext()) {
let keyword = keywords.next();
console.log(`${keyword.getText()}: ${keyword.getStatsFor("YESTERDAY").getImpressions()}`);
}
}
Just wanted to mention in case that sample script page needs an edit.
Best,
Misty Harper