Script to correct capitalisation errors

116 views
Skip to first unread message

hannahprofi...@gmail.com

unread,
Jun 28, 2022, 10:46:16 AM6/28/22
to Google Ads Scripts Forum
I am trying to install the following script:


However I get the following error:


28/06/2022 11:34:51
Exception: Call to GoogleAdsService.Search failed: = is not a valid operator to use with 'ad_group_ad.policy_summary' in WHERE clause. Valid operators: . at adsapp_compiled:18083:138 at adsapp_compiled:18094:9 at ra (adsapp_compiled:227:15) at Object.search (adsapp_compiled:235:20) at eI.search (adsapp_compiled:18209:36) at OH.search (adsapp_compiled:17786:19) at PH.search (adsapp_compiled:17881:20) at WH.search (adsapp_compiled:17973:19) at ed (adsapp_compiled:1041:32) at ed.next (<anonymous>)


How can I resolve this please?

Peter Valenta

unread,
Jun 29, 2022, 6:29:49 PM6/29/22
to Google Ads Scripts Forum
The policy_summary attribute resource fields are ENUM. You can only use the following clauses for ENUM:

=
!=
IN
NOT IN


So to resolve the issue change the policy summary selector you are using to use one of the above clauses, instead of WHERE, which is not supported.

Peter Valenta

unread,
Jun 29, 2022, 6:34:05 PM6/29/22
to Google Ads Scripts Forum
So try changing the line

var ad_iter = AdWordsApp.ads().withCondition("ApprovalStatus = 'DISAPPROVED'").get();

to

var ad_iter = AdWordsApp.ads().withCondition("ApprovalStatus = DISAPPROVED").get();

On Tuesday, 28 June 2022 at 16:46:16 UTC+2 hannahprofi...@gmail.com wrote:

Google Ads Scripts Forum Advisor

unread,
Jun 30, 2022, 2:59:14 AM6/30/22
to adwords...@googlegroups.com

Hello everyone,

I’m James from the Google Ads script support team. Thank you for reaching out to our forum channel.

@Peter - Thank you for sharing your insights with this issue. We greatly appreciate your efforts.

@Hannah - Please let us know if you will still encounter the same issue after trying the given suggestion by Peter, so that we can validate and proceed with further investigation. If the error persists, kindly provide us with the following items below.

  • Google Ads account ID / CID
  • Script Name

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2cEhx3:ref

hannahprofi...@gmail.com

unread,
Jul 11, 2022, 12:37:05 PM7/11/22
to Google Ads Scripts Forum
Thank you - got the following error (with the amend suggested by Peter):


07/07/2022 14:45:58
Exception: Call to GoogleAdsService.Search failed: = is not a valid operator to use with 'ad_group_ad.policy_summary' in WHERE clause. Valid operators: . at adsapp_compiled:18112:138 at adsapp_compiled:18123:9 at sa (adsapp_compiled:227:15) at Object.search (adsapp_compiled:235:20) at iI.search (adsapp_compiled:18238:36) at SH.search (adsapp_compiled:17815:19) at TH.search (adsapp_compiled:17910:20) at $H.search (adsapp_compiled:18002:19) at fd (adsapp_compiled:1041:32) at fd.next (<anonymous>)


Google Ads Scripts Forum Advisor

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

Hello Hannah,

I checked your script and I observed that you’re executing / running it using the new script experience version. Having said that, the usage of the ApprovalStatus field within your condition is expected to fail. I said this because the said field is still in AWQL format which is no longer supported in the new script experience environment. Please be reminded that the new script experience version is now based on Google Ads API infrastructure.

Going back to the error, you may try to implement the code below and let me know how it goes on your end.

var ad_iter = AdsApp.ads().withCondition("ad_group_ad.policy_summary.approval_status = DISAPPROVED").get();
Reply all
Reply to author
Forward
0 new messages