How to filter on repeated fields in AWQL

79 views
Skip to first unread message

Zweitze

unread,
Mar 16, 2023, 10:16:06 AM3/16/23
to Google Ads API and AdWords API Forum
Hi,

I am looking to query report keyword_view, and retrieve all keywords that have one or more final_uls set. I wonder how to do that?
According to the docs of  ad_group_ad.ad.final_urls this is a REPEATED STRING field, unfortunately the language grammar guide does not state which operators apply to them. (Actually the language grammar guide lacks documentation on field types and the conditions that may apply to them...)

When trying to add a condition on this field in the Google Ads Query Builder, three operators are offered: CONTAINS ALL, CONTAINS ANY, and CONTAINS NONE.

But then I have to enter a value. What possible value could I enter? When I type NULL, Google Ads Query Builder takes that as a string value. And I can't leave the value empty...

How does one get all keywords with one or more final_urls?

The use case:
Some accounts have 100,000s of keywords, and less than 0.1% of them have one or more final_urls - I am interested in these keywords, not the ones without final_urls. The workaround is to retrieve all of them and filter on the client side, but that wastes resources of both Google and us. And it's not just keyword_view, the same applies to audiences.
I also need the opposite version, get all keywords without final_urls.

Google Ads API Forum Advisor

unread,
Mar 16, 2023, 3:38:40 PM3/16/23
to zwe...@gmail.com, adwor...@googlegroups.com

Hello Zweitze,

Welcome to Google Ads API support team. Thank you for reaching out to us.

With regards to your concern, kindly provide the following so we can investigate further on our end:

  • CID
  • screenshot of the sample data you want to retrieve in UI


You may send the requested details privately via "Reply To Author" option. If that option is not available, send directly to googleadsa...@google.com instead.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2jzXcw:ref

Zweitze

unread,
Mar 20, 2023, 1:25:41 PM3/20/23
to Google Ads API and AdWords API Forum
Hello,

Do I really have to provide a screenshot of the "Search keywords" UI?
Of course not. Anyway, for example use 371-225-2729 and clear any filter that may be present.

Notice that this particular account has 162,011 search keywords, including deleted keywords. Also notice that some of them have a final url.

Now, my question, In UI terms:
How do I get all search keywords that have one or more final url? Do I have to set "Show rows" to 500, then click "next" 324 times? I think that's a waste of bandwidth.

Actually, that's why we're automating, and we use keyword_view. But I don't see how I can filter in AWQL on this repeated field, for condition "has values" or "has no values".


I hope my question is clear now?

Google Ads API Forum Advisor

unread,
Mar 20, 2023, 7:28:35 PM3/20/23
to zwe...@gmail.com, adwor...@googlegroups.com
Hello Zweitze,

Thank you for returning to our team.

Regarding your question, please note that the reason why we are asking for the Google Ads UI screenshot is because you mentioned that you want to retrieve all keywords that have one or more final_urls set. We are asking for the Google Ads UI screenshot that will show that this functionality is available in the UI because the Google Ads API mirrors each other. So, if this is available in the UI and not in the API, then our team should raise a feature request for this. However, if this is not available/possible in the Google Ads UI, then I am afraid that this is also not possible in the Google Ads API.

As for "How do I get all search keywords that have one or more final url? Do I have to set "Show rows" to 500, then click "next" 324 times? I think that's a waste of bandwidth.", please note that our team supports Google Ads API-related concerns and technical implementations only. That said, I would recommend reaching out to the Google Ads Product support team as they are the ones who provide support to UI-related concerns.

Furthermore, the ad_group_ad.ad.final_urls is a STRING and this is the reason why when you type NULL, Google Ads Query Builder takes that as a string value.

Zweitze

unread,
Mar 21, 2023, 8:56:29 AM3/21/23
to Google Ads API and AdWords API Forum
Hello,

Thank you for your answer.

I am not sure if it is still the case, but 10, 15 years ago the Terms and Conditions stated that the client should not execute more requests than strictly necessary. To comply with such stipulations, one has to do as much filtering as possible. Let's assume that in the given account, not a single keyword has one final_url set - but there's still 162,011 keywords.
For the API to retrieve all keywords with final_url set, this would require 163 API requests, each call returning 1,000 keywords. The client would need to do the filtering and throw all these keywords away. Now, if it was possible to enter a filter in AWQL, the client would only need one API call - 16,200% faster. I am sure you get the point.

Does the T&C no longer require to reduce the API calls?
Of course I still have to deal with rate limitations - there's only so many API requests I can make per minute (Google Firewall), per hour, per day. How do I deal with that, if I have to use such many API requests?

Looking forward to your response,
Thanks!

Google Ads API Forum Advisor

unread,
Mar 21, 2023, 3:18:56 PM3/21/23
to zwe...@gmail.com, adwor...@googlegroups.com
Hi Zweitze,

Thank you for your response. 

Unfortunately, the filtering you are seeing in the Query builder shows the only possible Google Ads API. The reason we are requesting the screenshot of the Google Ads UI is so that we can confirm whether or not this is actually in the Google Ads API. If it is in the Google Ads UI, then the API should be able to obtain it; if not, we will submit a feature request.

Please note that the Google Ads API mirrors the Google Ads UI. Whatever data or feature shows up on the Ads UI report, the API should have it the same. 

Best regards,

Zweitze

unread,
Mar 22, 2023, 1:01:33 PM3/22/23
to Google Ads API and AdWords API Forum
Thank you.

Obviously my wish is about something that one cannot do in the UI.
So, if you don't know a way to achieve my wish (a condition-operator for repeated fields with 1 or more values, and a condition-operator for repeated fields without any value) - well please submit a feature request.

Google Ads API Forum Advisor

unread,
Mar 22, 2023, 7:23:14 PM3/22/23
to zwe...@gmail.com, adwor...@googlegroups.com
Hi Zweitze,

Thank you for your response. 

Regarding your concern, allow me to raise this issue to the wider team for further guidance. Rest assured that we will get back to you as soon as we have updates.

Regards,

Google Ads API Forum Advisor

unread,
Mar 23, 2023, 1:13:32 PM3/23/23
to zwe...@gmail.com, adwor...@googlegroups.com
Hi Zweitze,

I hope you're safe and doing fine. 

We've checked again your use case and can confirm that this cannot be done using CONTAIN ANY or CONTAINS NONE via Google Ads API query report. I've submitted a feature request for this. For now, you may continue to follow our blog for updates and announcements regarding this.
Reply all
Reply to author
Forward
0 new messages