Label names selector doesn't work

57 views
Skip to first unread message

James Johnson

unread,
Jun 16, 2022, 6:16:49 AM6/16/22
to Google Ads Scripts Forum
Hi Support
I'm having issues selecting accounts with a label associated to them.

According to this documentation I believe this should work:

var account = AdsManagerApp.accountLabels()
     .withCondition("Name CONTAINS ANY ('Ownership')")
     .withCondition("Name CONTAINS NONE ('Client ownership') ")
                                                     .get(),
Cite:
https://developers.google.com/google-ads/scripts/docs/reference/adsmanagerapp/adsmanagerapp_accountlabelselector

However, the output from Google Scripts using the new experience is:

06/06/2022 13:00:22
Exception: Call to GoogleAdsService.Search failed: Unrecognized field in the query: 'Name'. at adsmanagerapp_compiled:3285:130 at adsmanagerapp_compiled:3296:9 at xa (adsmanagerapp_compiled:322:15) at Object.search (adsmanagerapp_compiled:331:20) at Gi.search (adsmanagerapp_compiled:3396:35) at qi.search (adsmanagerapp_compiled:2994:19) at si.search (adsmanagerapp_compiled:3085:19) at zi.search (adsmanagerapp_compiled:3175:19) at Kb (adsmanagerapp_compiled:699:11) at Kb.next (<anonymous>)


What is the best way to select accounts to work on using the new Google Scripts interface please, as I have a few I need to migrate over ASAP.

Kind regards.

James

Google Ads Scripts Forum Advisor

unread,
Jun 16, 2022, 4:15:40 PM6/16/22
to adwords...@googlegroups.com
Hi James,

Thanks for reaching out. It appears you have a set of parentheses outside of the string used in the condition. Also, please refer to the page you linked that gives the supported operators for strings:

=  !=  STARTS_WITH  STARTS_WITH_IGNORE_CASE
 CONTAINS  CONTAINS_IGNORE_CASE  DOES_NOT_CONTAIN  DOES_NOT_CONTAIN_IGNORE_CASE

Regards,

Google Logo
Matt
Google Ads Scripts Team
 


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