Filter AdGroups by label with GAQL

29 views
Skip to first unread message

Dmitrii Stebliuk

unread,
Dec 13, 2019, 10:08:34 AM12/13/19
to AdWords API and Google Ads API Forum
Hello, I am getting AdGroups by a label and I would like to write a GAQL script.

I am using the GAQL builder
I choose a resource: ad_group.
In the fields, I see "ad_group.labels", but in the filters, there are no labels.

How can I filter ad_groups by a label in the GAQL?

Google Ads API Forum Advisor Prod

unread,
Dec 13, 2019, 3:48:14 PM12/13/19
to adwor...@googlegroups.com
Hi Dmitrii,

Thank you for reaching out. You can filter by label by adding "WHERE ad_group.labels CONTAINS ANY  ()" clause to your query. You must list out the resource name within the parenthesis using this format 'customers/{customer_id}/labels/{part_1}\'.

Regards,
Mitchell
Google Ads API Team

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