Script time out in new script experience version

455 views
Skip to first unread message

Martin B

unread,
Jun 30, 2022, 9:05:16 AM6/30/22
to Google Ads Scripts Forum
Hello,

I just tried to run a script in the new script experience version. In the old script backend it works without any issues since years, but when I toggle on the new experience option I always get the error message that it was stopped because it exceeded time limits (no protocol and no other information is given). In the old version the execution time was always just a few seconds or one minute at most, never longer.

So I have no idea why it is exceeding time limits when the new script experience is toggled on. Nothing else was changed.

What can I do to make it work in the new script experience as well? The old script experience will stop working in a few months.

The script is a custom MCC level anomalies detector which compares stats of yesterday with the average daily stats of the last 21 days.

Thank you so much for your help!

Kind regards,
Martin

Google Ads Scripts Forum Advisor

unread,
Jul 1, 2022, 3:03:59 AM7/1/22
to adwords...@googlegroups.com

Hi Martin,

 

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

 

For us to further investigate this and guide you accordingly, can you please provide the following information below:?

  • Google Ads ID / CID
  • Screenshot that shows that issue
  • Script’s name

 

Kindly send the requested details above via ‘Reply privately to author’ option, if the private option is not available on your end, then please send it over through this email <googleadsscr...@google.com> instead.

 

Regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2cEwE3:ref

Martin B

unread,
Jul 1, 2022, 4:59:06 AM7/1/22
to Google Ads Scripts Forum
Hi Yasmin,

Thank you. I sent you an email to the email address you mentioned as the  ‘Reply privately to author’ option is not available.

The weird thing is:
Now even when I toggled off the new script experience the script continues to fail and I still get the error that the script exceeded time limits. But it was working without any issues since years until I toggled on the new script experience. I haven't changed anything else. Weird that it's now even not working when turning the new script experience / backend off again...

Kind regards,
Martin

Google Ads Scripts Forum Advisor

unread,
Jul 3, 2022, 11:42:38 PM7/3/22
to adwords...@googlegroups.com

Hello Martin,

 

Maia here, I’m a colleague of Yasmin from the same team. Thank you for sharing with us the needed information privately. Allow me to further assist you.

 

Unfortunately, the 30 minute execution time is the standard limit in the Google Ads Scripts and when the executeInParallel is used, scripts can execute up to a maximum of 60 minutes before being cancelled at the MCC level. See Limits for your reference.

 

Since this is an unusual behavior and upon checking the script on your account, I noticed that you are using a reports spreadsheet. Can you share with us the shareable link of the spreadsheet that you have used so that we can test it on our end?

 

Kindly share it via ‘Reply privately to author’ option. If the option is not available, then please send it through our email <googleadsscr...@google.com> instead.

 

Best Regards,

Google Logo
Angel Maia
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2cEwE3:ref

Martin B

unread,
Jul 4, 2022, 2:46:30 AM7/4/22
to Google Ads Scripts Forum
Hello Maia,

Thank you. I sent you the link to the spreadsheet to the email address you mentioned as the  ‘Reply privately to author’ option is not available.

I know that there are execution time limits. But the script never took longer than 1 minute under the old script experience where it always worked flawlessly since years. Only after toggling on the new script experience I get the error that the script reached the time limit. The weird thing is: Now even when I toggled off the new script experience the script continues to fail and I still get the error that the script exceeded time limits. I haven't changed anything else.

Kind regards,
Martin

adsscripts schrieb am Montag, 4. Juli 2022 um 05:42:38 UTC+2:

Hello Martin,

 

Maia here, I’m a colleague of Yasmin from the same team. Thank you for sharing with us the needed information privately. Allow me to further assist you.

 

Unfortunately, the 30 minute execution time is the standard limit in the Google Ads Scripts and when the executeInParallel is used, scripts can execute up to a maximum of 60 minutes before being cancelled at the MCC level. See Limits for your reference.

 

Since this is an unusual behavior and upon checking the script on your account, I noticed that you are using a reports spreadsheet. Can you share with us the shareable link of the spreadsheet that you have used so that we can test it on our end?

 

Kindly share it via ‘Reply privately to author’ option. If the option is not available, then please send it through our email <googleadsscripts-support@google.com> instead.

Google Ads Scripts Forum Advisor

unread,
Jul 4, 2022, 5:50:59 AM7/4/22
to adwords...@googlegroups.com

Hello Martin,

 

Michael here from Google Ads scripts Team. I work along with Maia.

 

Reading through the thread, I can see that you are encountering executime time limit errors on your anomalies_v1.1.js. With the shared spreadsheet, I was able to test the behavior on my end. However, I did not encounter the same error as the script appears to run correctly on both legacy and new scripts experience. With this, would you be able to confirm if you are still seeing the issue? Kindly try running it now and share to us the screenshot of the results and we will raise it to the rest of our team should the issue persist on your end.

Regards,

 

Google Logo
Michael Angelo
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2cEwE3:ref

Martin B

unread,
Jul 4, 2022, 6:07:06 AM7/4/22
to Google Ads Scripts Forum
Hello Michael,

Thank you for your reply.

Yes, I'm encountering execution time limit errors on my "anomalies_v1.1.js" script. When you say you can see it running correctly you must be looking at the wrong script. Attached please find a screenshot of the script history. I filtered for the "anomalies_v1.1.js" script and you can see that it fails every hour with the German error message in red "Wegen Zeitüberschreitung angehalten", which means "Stopped due to timeout". This only happens since I toggled on and off the new script experience last week.

Before I toggled on and off the new script experience last week the script never took longer than 1 minute under the old script experience where it always worked flawlessly since years. Only after toggling on the new script experience I get the red error that the script reached the time limit that you can see in the screenshot. Even when I toggled off the new script experience the script continues to fail and I still get the error that the script exceeded time limits. I haven't changed anything else.

Kind regards,
Martin
Bildschirmfoto 2022-07-04 um 11.55.33.png

Google Ads Scripts Forum Advisor

unread,
Jul 5, 2022, 2:24:06 AM7/5/22
to adwords...@googlegroups.com

Hi Schafer,

 

Thank you for your response.

 

I can confirm that our team investigated the correct script (anomalies_v1.1.js) as mentioned. That being said, I would recommend that you follow this migration guide and convert your script to GAQL using this query migration tool as well as this resource mapping document since I observed that you’re still using an AWQL query. I said this because there are fields which are not compatible with the new experience.

 

After converting your script, kindly try executing it in the new experience and let us know if you would still encounter a timeout on your end when executing the script.

 

Regards,

 

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2cEwE3:ref

Martin B

unread,
Jul 5, 2022, 3:51:39 AM7/5/22
to Google Ads Scripts Forum
Hello Yasmin,


Thank you for your reply.

But if the script really needs to be migrated, why was your colleague Michael able to run it successfully both in the old and new script experience? I think there must be another issue when your colleague was able to run it successfully!?

Also why is the script even not running anymore in the old script experience? Before I toggled on and off the new script experience last week the script worked flawlessly since years. Only after toggling on the new script experience I get the error that the script reached the time limit. However, even when I toggled off the new script experience so that it uses the old script experience gain it still continues to fail and I still get the error that the script exceeded time limits when using the old script experience again. I haven't changed anything else. Why is this happening?

Kind regards,
Martin

Google Ads Scripts Forum Advisor

unread,
Jul 5, 2022, 5:59:56 AM7/5/22
to adwords...@googlegroups.com

Hi Martin,

 

I've scrutinized your script and found that there isn't anything wrong with your implementation. For context, many AWQL reports will continue to function. Behind the scenes, when using the new infrastructure, scripts will convert your AWQL query to GAQL (the new query language for the Google Ads API), run it against the new backend, and then convert the results back to the format originally used by AWQL reports. Hence, it is using additional resources which is causing it to fail sometimes. Queries with GAQL will pass through as is. Furthermore, the behaviour being exhibited is a case to case basis because there are many accounts being processed. Upon checking on my end, 19 accounts were processed and did not reach the limit.

 

What I may suggest you do is to recreate the script with the new experience already toggled. You may also try to filter the account based on the label and create multiple copies so that each new script will only work on each subset of your accounts based on the specified label. This is so that the script will not reach the execution limit.

Martin B

unread,
Jul 6, 2022, 5:33:37 AM7/6/22
to Google Ads Scripts Forum
Hello everyone,

Just want to let you know that it works again now after I have simply created a new script with exactly the same source code and it works now again fast in just a few seconds without any issues even with the new script experience toggled on.

Thank you.

Kind regards,
Martin

Google Ads Scripts Forum Advisor

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

Hi Martin,


Thank you for the update.


Our team is happy to hear that. If you have further questions / concerns for our team, please feel free to get back to us. We will be happy to address it.


Regards,

Google Logo
Darwin
Google Ads Scripts Team
 


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