Failed due to system errors

124 views
Skip to first unread message

Søren Jespersen

unread,
Jul 11, 2022, 1:59:08 PM7/11/22
to Google Ads Scripts Forum
Hi

I have made a script to check if all active ad groups have active keywords and if not should export the ad groups with missing keywords to a Google sheet.

But when it runs it often says it "Failed due to system errors" and gives this error message:
Skærmbillede 2022-07-11 kl. 14.24.53.png

I don't know why it does this, i have asked around, and i have been told that is might be a runtime error. And that it could have something to do with the syntax loop. But i don't know how to fix it.

The script looks like this:
/**********************
Keyword Checker
**********************/

var SPREADSHEET_URL = 'INSERT SHEET URL HERE';
var Sheet_name = 'INSERT SHEET NAME HERE';

function main() {
 var sheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL).getSheetByName(Sheet_name);
 var range = sheet.getRangeList(['A1:A', 'B1:B'])
 range.clearContent();
 sheet.getRange("A1").setValue("Campaign");
 sheet.getRange("B1").setValue("Ad groups");

 var GetAdGroups = AdWordsApp.adGroups()
 .withCondition('Status = ENABLED')
 .withCondition('CampaignStatus = ENABLED')
 .withCondition("AdvertisingChannelType = SEARCH")
 .withCondition("CampaignName DOES_NOT_CONTAIN_IGNORE_CASE 'dsa'")
 .withCondition("AdGroupName DOES_NOT_CONTAIN_IGNORE_CASE 'dsa'")
 .withCondition("campaign.experiment_type = BASE")
 .get();

 for (var row = 2; GetAdGroups.hasNext(); row ++) {
 var AdGroups = GetAdGroups.next();
 var KeywordCount = AdGroups.keywords().withCondition('Status = ENABLED').get().totalNumEntities();
if ((KeywordCount < 1)) {

 sheet.appendRow( [AdGroups.getCampaign().getName(), AdGroups.getName()] );

 }
 }
}

Google Ads Scripts Forum Advisor

unread,
Jul 12, 2022, 2:00:36 AM7/12/22
to adwords...@googlegroups.com

Hi Søren,

 

Thank you for reaching out to us. This is Yasmin from the Google Ads Scripts team.

 

For us to further investigate this and assist you, we would like to request for you to provide the following information below:

  • Google Ads account ID / CID
  • Script name
  • Screenshot of the error
  • Shareable link of your spreadsheet

 

Kindly send the requested items via `Reply privately to author` option. If the said option is not available on your end, you may send those through this email alias <googleadsscr...@google.com> instead.

 

Regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


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