GAQL Query For Distinct Resource Names?

246 views
Skip to first unread message

Pete Lavetsky (AdWords API Guru)

unread,
May 27, 2022, 9:39:41 AM5/27/22
to Google Ads API and AdWords API Forum
Hi all,

Does the Distinct concept exist in GAQL when not segmenting by date or similar?

For instance, if we had an account that had 100,000 CALL AdGroup Extensions, we could run this query to get all the ad_group resource names but it performs slowly because it's examining each ad_group_extension_setting record:

SELECT ad_group_extension_setting.ad_group FROM ad_group_extension_setting WHERE ad_group_extension_setting.extension_type = 'CALL' ORDER BY ad_group_extension_setting.extension_type DESC

What I really want is:

SELECT distinct( ad_group_extension_setting.ad_group ) FROM ad_group_extension_setting WHERE ad_group_extension_setting.extension_type = 'CALL'

and I would want hat 2nd query to be very performant.

Is it possible to query for distinct resource_names?

Thanks
Pete

Google Ads API Forum Advisor

unread,
May 30, 2022, 5:51:23 AM5/30/22
to pete.l...@gmail.com, adwor...@googlegroups.com

Hi Pete,

Thanks for reaching out to the Google Ads API Forum.

Unfortunately, the distinct keyword is not supported in GAQL. To construct a query in Google Ads Query Language, you will need to build it using the language grammar as mentione in this guide.

Let us know if you have any additinal questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 


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