Script for RSAs

456 views
Skip to first unread message

Henry Breakwell

unread,
Nov 18, 2021, 8:50:09 AM11/18/21
to Google Ads Scripts Forum
Was looking at this script for looking at RSA ad performance. Seems to be returning a few errors. 

Getting this error within the log. 

"Argument cannot be null: sheet (file Code.gs, line 29)".



var config = {
LOG : true, // Make a copy of this script and copy the URL: https://docs.google.com/spreadsheets/d/1WvNSbaZi2dz3Uu74AIniKy5YLHctZ_6c6i0Gp2DQ8ns/copy SPREADSHEET_URL : "https://", SHEET_NAME : "RSA" } //////////////////////////////////////////////////////////////////// function main() { if(config.SPREADSHEET_URL == "https://"){ throw Error("Make a copy of the sheet and paste the URL in the config \nhttps://docs.google.com/spreadsheets/d/1WvNSbaZi2dz3Uu74AIniKy5YLHctZ_6c6i0Gp2DQ8ns/copy"); } var ss = SpreadsheetApp.openByUrl(config.SPREADSHEET_URL); var sheet = ss.getSheetByName(config.SHEET_NAME); var report = AdsApp.report( "SELECT CampaignName, AdGroupName, Id, AdStrengthInfo " + "FROM AD_PERFORMANCE_REPORT " + "WHERE AdType = RESPONSIVE_SEARCH_AD " + "AND CampaignStatus = ENABLED " + "AND AdGroupStatus = ENABLED " + "AND Status = ENABLED" ) // Export data and clean up sheet sheet.clearContents(); report.exportToSheet(sheet); sheet.autoResizeColumns(1, sheet.getLastColumn()); if(sheet.getMaxColumns() - sheet.getLastColumn() != 0){ sheet.deleteColumns(sheet.getLastColumn() + 1, sheet.getMaxColumns() - sheet.getLastColumn()); } if(config.LOG === true){ var rows = report.rows(); while(rows.hasNext()){ var row = rows.next(); Logger.log("Campaign: " + row["CampaignName"] + " - Adgroup: " + row["AdGroupName"] + " - " + row["AdStrengthInfo"]); } // rowIterator } Logger.log("Export completed"); } // function main()




Henry Breakwell

unread,
Nov 18, 2021, 8:50:54 AM11/18/21
to Google Ads Scripts Forum
Any ideas? Not sure if its just outdated?

Henry Breakwell

unread,
Nov 18, 2021, 11:14:06 AM11/18/21
to Google Ads Scripts Forum
Obviously script would have correct url for sheet to pull data into. just having issues with other parts of script

Google Ads Scripts Forum Advisor

unread,
Nov 18, 2021, 10:47:56 PM11/18/21
to adwords...@googlegroups.com
Hi Henry,

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

Kindly provide your Google Ads account ID, script's name and a shareable link to your spreadsheet if available so I can take a look closer at the issue you are encountering. You may send the spreadsheet privately via the reply to author option.

Looking forward to your reply.

Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2RA9V0:ref

Henry Breakwell

unread,
Nov 19, 2021, 8:04:32 AM11/19/21
to Google Ads Scripts Forum
Hi Harry,

Sure, Account ID: 799-851-0368,  script name "RSA Ad Performance Script", can't reply to author only, its greyed out for me.

Let me know how to correct that,

Thanks

Henry Breakwell

unread,
Nov 19, 2021, 8:05:51 AM11/19/21
to Google Ads Scripts Forum
Do you have an email I can share it with ?
Screenshot 2021-11-19 at 13.05.05.png

Google Ads Scripts Forum Advisor

unread,
Nov 21, 2021, 11:14:09 PM11/21/21
to adwords...@googlegroups.com
Hi Henry,

Thanks for coming back. You can send private information through our email instead ( googleadsscr...@google.com). However, can you kindly check that the tab name in your sheet is the same as the one you have in your script (RSA Numan Performance)?

Google Ads Scripts Forum Advisor

unread,
Nov 26, 2021, 2:05:07 AM11/26/21
to adwords...@googlegroups.com
Hi Henry,

We've received your message privately. Unfortunately, we still wasn't able to access the spreadsheet. With this, could you kindly send us a local copy instead to googleadsscr...@google.com?

Regards,
Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2RA9V0:ref

Henry Breakwell

unread,
Nov 26, 2021, 4:36:44 AM11/26/21
to Google Ads Scripts Forum on behalf of adsscripts
Sure, 

Doing it now

--
-- 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 a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/s5E_DybqzI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/tlsmJ000000000000000000000000000000000000000000000R363OC00VtbVEEA5RnC0ELTaIDlypA%40sfdc.net.

Google Ads Scripts Forum Advisor

unread,
Nov 28, 2021, 9:49:39 PM11/28/21
to adwords...@googlegroups.com
Hi Henry,

Thanks for coming back. I regret to say that we are still unable to access the spreadsheet through the link you have provided. Would you mind double checking if sharing is enabled or 'Anyone with the link' is selected? On the other hand, would you mind that you also attach a local file copy of the sheet instead as requested by my colleague? You can get the local file copy of the sheet by downloading it (File > Download > Microsoft Excel .xlsx). We should be able to fully troubleshoot your script thereafter and guide you accordingly.


Looking forward to your reply.

Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2RA9V0:ref

Henry Breakwell

unread,
Dec 2, 2021, 4:38:49 AM12/2/21
to Google Ads Scripts Forum on behalf of adsscripts
Hi ,

Sorry I think I didn't share it correctly last time. Should be correct now and fine to access.

--
-- 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 a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/s5E_DybqzI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.

Google Ads Scripts Forum Advisor

unread,
Dec 2, 2021, 11:59:05 PM12/2/21
to adwords...@googlegroups.com
Hi Henry,

Thank you for getting back to us.

I was able to check your script, and found what causes the error. It appears that the error is coming from var sheet = ss.getSheetByName(config.SHEET_NAME); which returns a null result. As per further checking, you've configured your script's config.SHEET_NAME to "RSA Ad Performance" while your Spreadsheet template sheet's name is just "RSA" which causes an issue. The error should be fixed if you configured the same name on both. With this, kindly rename your spreadsheet sheet name to "RSA Ad Performance" or update your scripts' config.SHEET_NAME to "RSA". 

Regards,
Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team
 


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