Shopping Performance Report Returning Zero Products

398 views
Skip to first unread message

Henry Freedman

unread,
Jun 10, 2022, 1:18:05 PM6/10/22
to Google Ads Scripts Forum
Hi guys,

I'm using this script from Google to try to identify products with zero clicks in the last 30 days. The problem is, when I run it in accounts it returns 0 products. If I change the filter to 2 clicks or by impression I find products, but not as many as I should. Do products need at least 1 click to be present in the Shopping Performance Report? How do I get around this? 

var SPREADSHEET_URL = "xx";
// Enter your filters below, for multiple filters use AND clause. E.g. Impressions > 100 AND Clicks < 1
// Currently default filter is Clicks < 1 i.e. Zero Clicks
var FILTERS = "Clicks < 1";
// Enter time duration below. Possibilities:
// TODAY | YESTERDAY | LAST_7_DAYS | LAST_WEEK | LAST_BUSINESS_WEEK | THIS_MONTH | LAST_MONTH |
// LAST_14_DAYS | LAST_30_DAYS | THIS_WEEK_SUN_TODAY | THIS_WEEK_MON_TODAY | LAST_WEEK_SUN_SAT
// Currently default time duration is set to: LAST_30_DAYS
var TIME_DURATION = "LAST_30_DAYS";
var COUNT_LIMIT = 999999;
function main(){
var products = getFilteredShoppingProducts();
products.sort(function(a,b){return a[0] > b[0];});
products = products.slice(0, COUNT_LIMIT);
pushToSpreadsheet(products);
}
function getFilteredShoppingProducts(){
var query = "SELECT OfferId FROM SHOPPING_PERFORMANCE_REPORT WHERE " + FILTERS + " DURING "+ TIME_DURATION;
var products = [];
var count = 0;
var report = AdWordsApp.report(query);
var rows = report.rows();
while (rows.hasNext()){
var row = rows.next();
var offer_id = row['OfferId'].toString();
products.push([offer_id]);
count+= 1;
}
Logger.log(count);
return products;
}
function pushToSpreadsheet(data){
var spreadsheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL);
var sheet = spreadsheet.getSheetByName('Custom_Label');
var lastRow = sheet.getMaxRows();
sheet.getRange('A2:A'+lastRow).clearContent();
var start_row=2;
var endRow=start_row+data.length-1;
var range = sheet.getRange('A'+start_row+':'+'A'+endRow);
if (data.length>0){range.setValues(data);}
return;
}

Google Ads Scripts Forum Advisor

unread,
Jun 10, 2022, 4:13:55 PM6/10/22
to adwords...@googlegroups.com
Hello,

Thanks for reaching out. The shopping performance report query from the old AdWords API is converted to the new Ads API shopping_performance_view in the Ads scripts backend. As discussed here, Ads API reporting automatically excludes zero impression rows when a report is segmented. As your report segments by date, zero impression data will be excluded for the given date range. Can you please confirm if this behavior is consistent with what you are seeing?

Thanks,

Google Logo
Matt
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2b6cbv:ref

Henry Freedman

unread,
Jun 13, 2022, 10:41:29 AM6/13/22
to Google Ads Scripts Forum
Hi Matt,

Thanks for your response. That is what I'm seeing, is there a way to still identify the offer IDs with zero impressions?

Thanks.

Google Ads Scripts Forum Advisor

unread,
Jun 15, 2022, 2:22:07 AM6/15/22
to adwords...@googlegroups.com

Hi Henry,
 

Thank you for getting back to us. I work with Matt and allow me to assist you here.


Moving forward to your concern, allow me to reiterate your question "is there a way to still identify the offer IDs with zero impressions?" With this, I'm Afraid that there is no way to identify the offer IDs with zero impressions. However, zero impressions can be returned if you use other metric fields for that row.


Regards,

Google Logo
Darwin
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2b6cbv:ref

Henry Freedman

unread,
Jun 15, 2022, 12:53:26 PM6/15/22
to Google Ads Scripts Forum
Hi Darwin,

Thank you for your response. What metric can I add to identify rows for an offer ID with 0 clicks and 0 impressions?

Thank you.

Google Ads Scripts Forum Advisor

unread,
Jun 16, 2022, 3:00:16 AM6/16/22
to adwords...@googlegroups.com
Hello,

I work along with Darwin and Matt. Thank you for getting back to us.

With regard to your concern, you will need to add another metric in your query (e.g conversion). You may check the sample query here. Please do note that rows whose selected metrics are all zero won't be returned.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2b6cbv:ref

Henry Freedman

unread,
Jun 16, 2022, 1:06:51 PM6/16/22
to Google Ads Scripts Forum
Hi Teejay,

A product with 0 impressions and 0 clicks can't have a conversion, right? So what metric would not be zero if a product has zero impressions and zero clicks?

Thanks.

Google Ads Scripts Forum Advisor

unread,
Jun 21, 2022, 3:55:14 AM6/21/22
to adwords...@googlegroups.com

Hi Henry,


Thank you for getting back to us.
 

Regarding these questions "A product with 0 impressions and 0 clicks can't have a conversion, right?" I want to clarify on what my colleague "Teejay" said that if you want to "identify rows for an offer ID with 0 clicks and 0 impressions" you will need to add another metric in your query (e.g conversion) . Also, with these questions "So what metric would not be zero if a product has zero impressions and zero clicks?" You may refer to this guide. Please do note that rows whose selected metrics are all zero won't be returned.
 

Regards,

Google Logo
Darwin
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2b6cbv:ref

Henry Freedman

unread,
Jun 21, 2022, 10:53:35 AM6/21/22
to Google Ads Scripts Forum
Hi Darwin,

Thank you for your answer. Sorry, I read the guide and still am not understanding. What metric can I use that won't be 0 for a product with zero clicks and zero impressions?

Google Ads Scripts Forum Advisor

unread,
Jun 22, 2022, 1:51:05 AM6/22/22
to adwords...@googlegroups.com

Hello Henry,

I’m James from the Google Ads script support team. Allow me to assist you further.

I believe that you may check the table of your products in your Google Ads account interface to see what  metric does not contain zero value. From that, you may utilize it as a metric in your query in order to retrieve those products containing zero clicks and impressions.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2b6cbv:ref

Fursac Fursac

unread,
Jun 23, 2022, 2:48:01 AM6/23/22
to Google Ads Scripts Forum

Hello everyone, 

Hope you are great
Sorry for interfering in your conversation but i have the same issue that Henry faces right now. I have read all the answers but this page doesn't give me any help

By metric, you mean measurable metrics after the launching of an ads campaign (conversion, ctr, conversion value..described in this page) ? if so, actually i have no ideas for a metric that can be positive with this rule "products with a 0 clicks and 0 impressions"

It will be really helpful if you send us some ideas.

Thanks in advance
Sincerely yours, 
Michel

Google Ads Scripts Forum Advisor

unread,
Jun 23, 2022, 6:32:43 AM6/23/22
to adwords...@googlegroups.com

Hi Michel,

This is Ciara from the Google Ads Scripts team as well. Allow me to answer your question.

If your product has zero clicks and zero impressions, as the other metrics' value depends on the value of those two then they will also have zero values. To clarify, it would be intended behavior that the said product would not be returned on the resulting report even if you have included other metrics aside from the clicks and impressions as long as those other metrics also have zero values.

In addition, it appears that your concern is more on the Google Ads API Report rather than anything specific to the code implementation of the Google Ads Script. With that being said, I recommend that you reach out to the Google Ads API Forum for further assistance.

Let me know if you have any additional questions.

Regards,

Google Logo
Ciara
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2b6cbv:ref
Reply all
Reply to author
Forward
0 new messages