Low -volume SKU script

1,152 views
Skip to first unread message

Ksenia Havrylyshyna

unread,
Oct 6, 2021, 5:27:56 AM10/6/21
to Google Ads Scripts Forum
Hi! :)

I have a question regarding the recently shared by google low-volume sku script. The script itself works however it results in providing SKUs in lower case (for example uekd23) and most of our products have mixed values combining upper and lower case signs (e.g. uEkD23). Therefore when adding the file with SKU's generated by the script to the Merchant Center it has a really small coverage of products with our main feed. Is there a way to modify the script so that it will provide the SKU's in the format we have in our main feed?

Here is the script we use, I've removed only the spreadsheet url:
// Copy the link of the new sheet and paste it below -
var SPREADSHEET_URL =
// 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 = "Impressions = 0 AND Clicks = 0";
// 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;
}
Thanks in advance! 

Google Ads Scripts Forum Advisor

unread,
Oct 7, 2021, 1:02:01 AM10/7/21
to adwords...@googlegroups.com
Hi Kseniia,

Thanks for reaching out. Harry here, from the Google Ads Scripts Team.

The Shopping Performance Report will return the same values as you see in the Google Ads UI. Can you kindly check if the product SKU's in your Google Ads account follows the same format of your product feed? If not and it's the same the values that the report returns (Eg. uekd23), I would recommend reaching out to the Google Ads Product Team for further investigation as it would seem that this is a data discrepancy issue. Their team should be able to provide you further assistance in syncing the correct format of your product SKUs into your Google Ads account. If there are necessary changes to script thereafter, kindly reach back out to me so I can help you out.

Let me know your thoughts.

Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2PHFFO:ref

Mat

unread,
Jun 21, 2022, 11:04:33 AM6/21/22
to Google Ads Scripts Forum
I don't know why this thread is not continued. The "data discrepancy issue" is a normal Google Ads behavior - Google Ads makes the products SKU's lower case as the script does and this issue makes this solution unusable in many cases. It's not a single Google Ads account issue - it's the problem at the concept level.

Google Ads Scripts Forum Advisor

unread,
Jun 21, 2022, 11:30:24 AM6/21/22
to adwords...@googlegroups.com
Hi Mat,

If you are experiencing the same issue as Kseniia, can you please provide your own response to Harry's question?

"Can you kindly check if the product SKU's in your Google Ads account follows the same format of your product feed?"

Thanks,

Google Logo
Matt
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2PHFFO:ref

Mat

unread,
Jun 21, 2022, 11:35:56 AM6/21/22
to Google Ads Scripts Forum
Sure!

"Can you kindly check if the product SKU's in your Google Ads account follows the same format of your product feed?" - The format is different. Each capital letter is converted to a lower case. This is how it works for probably all Google Ads accounts. This is not a Google Ads UI bug, it was designed to work this way.

Google Ads Scripts Forum Advisor

unread,
Jun 21, 2022, 10:27:23 PM6/21/22
to adwords...@googlegroups.com

Hi Mat,
 

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

Moving forward to your concern, so our team can better check this concern, could you provide the CID and the Script name? So we could have a closer look at your concern.
 

Regards,

Google Logo
Darwin
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2PHFFO:ref

Radosław_P

unread,
Jul 25, 2022, 11:59:24 AM7/25/22
to Google Ads Scripts Forum
Hi,

it was mentioned that it was a script prepared by Google. Can I have a link to the Google documentation where this script was placed?

Thank you in advance for your help

Google Ads Scripts Forum Advisor

unread,
Jul 26, 2022, 2:30:58 AM7/26/22
to adwords...@googlegroups.com

Hi Radoslaw_P,
 

Thanks for your response. I hope you are doing well today.
 

With regards to your questions, "it was mentioned that it was a script prepared by Google. Can I have a link to the Google documentation where this script was placed?" Can I ask if the same script you are referring to in the initial message of this forum thread? So our team further checks and gives the recommended link to you.
 

Radosław_P

unread,
Jul 26, 2022, 10:54:33 AM7/26/22
to Google Ads Scripts Forum
Hi,

exactly, it's about the script that was placed in the first message of this topic.

Regards

Google Ads Scripts Forum Advisor

unread,
Jul 27, 2022, 2:31:06 AM7/27/22
to adwords...@googlegroups.com
Hi Radosław,

Thank you for your confirmation. The script on the initial thread is not part of our Solution Script which was build by us. Also, I've reviewed the script in question and it appears that it is utilizing AdWords reports which causes an issue since the New experience is now utilizing Google Ads API reports. 

I've updated the said script script which should work on the new experience. Could you please try it on your end, then let me know how it goes?

As an aside, you mentioned that the format that you were getting is different from the UI and the data from the said script, could you please provide to me a sample that you were getting and the data that you were expecting, so I could adjust the script further?

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2PHFFO:ref
LOW VOLUME SKU Script updated for new experience.txt

Radosław_P

unread,
Jul 29, 2022, 10:12:23 AM7/29/22
to Google Ads Scripts Forum
Hi,

thank you for your help. Script works!

Regard to that =>  As an aside, you mentioned that the format that you were getting is different from the UI and the data from the said script (..).

That isn't me who did mentioned that.  Maybe somene else in this topic.

Regards

Ahmet Çekici

unread,
Aug 1, 2022, 10:15:29 AM8/1/22
to Radosław_P przez Google Ads Scripts Forum
Revert my script settings, this is not my request. It is done with the attack of hackers. Please do not change my script settings.

29 Tem 2022 Cum 17:12 tarihinde Radosław_P przez Google Ads Scripts Forum <adwords...@googlegroups.com> şunu yazdı:
--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/c8a0e4a6-cd48-4d19-b75a-028df3552b88n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages