Google Ads Scripts Forum Advisor
unread,Sep 24, 2019, 1:48:02 PM9/24/19Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to adwords-scripts+apn2wqczzj3cza3o...@googlegroups.com, adwords-scripts+apn2wqczzj3cza3o...@googlegroups.co, adwords...@googlegroups.com
Hello,
Top impression percentage is not available at the moment through the
withCondition method. You can get keywords with the top impression percentage metric using
reports, however. For example:
var ids = [ ]; //Empty array that you will contain filtered keyword IDs and ad group IDs for keyword selector
var report = AdsApp.report(
"SELECT AdGroupId, Id " +
"FROM KEYWORDS_PERFORMANCE_REPORT " +
"WHERE Ctr > .01 " +
"AND Status = ENABLED " +
"AND TopImpressionPercentage > .5 " + //Sample value
"DURING LAST_7_DAYS "
);
var rows = report.rows();
while(rows.hasNext()) {
var row = rows.next();
var adGroupId = row['AdGroupId'];
var keywordId = row['Id'];
ids.push( [adGroupId, keywordId] );
}
var keywordIterator = AdsApp.keywords().withIds(ids).get();
Note that the keyword selector method, withIds, requires both an ad group ID and keyword ID because
keyword IDs are not unique.
Regards,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5001UHHl65:ref