Sudden script error - Cannot read property

161 views
Skip to first unread message

Edward Jones

unread,
Feb 28, 2022, 6:19:35 PM2/28/22
to Google Ads Scripts Forum
Greetings,

I found a script to automatically add close variant keywords as negatives.


It worked perfectly for over a month. All of a sudden it is not failing with the following error:

TypeError: Cannot read property 'length' of undefined at main (Code:204:58)

I haven't changed anything, so not sure why this is now causing a problem.

Any help would be greatly appreciated.

Best,
Ed

Google Ads Scripts Forum Advisor

unread,
Mar 2, 2022, 2:44:56 AM3/2/22
to adwords...@googlegroups.com
Hi Ed,

Thank you for reaching out to us.

For us to assist you further, could you please provide the following details via Reply privately to author option?
  • CID
  • Script Name
  • Shareable link of the spreadsheet being used in the script (if any)
In case you encounter an error when using the mentioned option, you can send the requested information on this email (googleadsscr...@google.com) instead, then let us know here once sent.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2XkA8A:ref

Chris Lantzy

unread,
Jun 15, 2022, 4:19:27 AM6/15/22
to Google Ads Scripts Forum
Hello Ed,

I experience a similar issue with this script. But the issue I had was the script made changes to multiple campaigns, even though I specified a campaign in the  var campaignNameContains = [];

Not sure if anyone has updated this script yet to be compatible with the new scripts experience. I wonder if the workaround in the meantime is to change  var makeChanges = true; to  var makeChanges = false; and make the changes manually, but that kind of defeats the purpose of automation. Please let me know what you find.

Thanks,
Chris

קידום אתרים אברהם רגבסקי

unread,
Jul 21, 2022, 3:03:40 PM7/21/22
to Google Ads Scripts Forum
Hi Ed,
I'm getting the same error. Have you found a solution?
Please share...
Thank you!

Google Ads Scripts Forum Advisor

unread,
Jul 22, 2022, 2:13:37 AM7/22/22
to adwords...@googlegroups.com

Hi,

This is Ciara from the Google Ads Script team. Thank you for reaching out to our public forum.



For us to assist you further, could you please provide the following details via Reply privately to author option?

  • CID
  • Script Name
  • Shareable link of the spreadsheet being used in the script (if any)


In case you encounter an error when using the mentioned option, you can send the requested information on this email (googleadsscr...@google.com) instead for private purposes.

Looking forward to your response.

Regards,

Google Logo
Ciara
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2bmVv0:ref

קידום אתרים אברהם רגבסקי

unread,
Jul 25, 2022, 11:59:07 AM7/25/22
to Google Ads Scripts Forum
close variant keywords as negative.png

Google Ads Scripts Forum Advisor

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

Hello,

I made a copy of your script and tested it on my end using both new script experience and legacy version. Upon executing the said script using the new script experience version, I was able to reproduce the same issue or error on my end. While upon trying to execute the said script using the legacy version(by toggling off the new script experience button) I wasn't able to encounter the said error and it works perfectly fine on my end.

I took a closer look at your script then I observed that you haven’t migrated your script to the new script experience set up which is the main reason why you encounter that specific error upon running your script in the new script experience version.

Having said that, you may opt to continue executing your script using the legacy version but please be reminded that as per our blog post, all new scripts will default to the new scripts experience, although you can still disable it on a script by script basis if necessary. Existing scripts won't be affected until September of 2022. After that, we will migrate all scripts to the new experience. You should manually move your scripts over to the new experience before then to ensure continued functionality.

Given that you’re using a third party script which is being created and maintained by brainlabsdigital.com, I would suggest that you raise this to their support team through this link as they are more knowledgeable on the implementation of their own script. Take note that third party scripts are already outside of our expertise. Moreover, you may also provide our migration document to them in order for them to make adjustments to their script to work properly in the new script experience environment in the future.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


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