Hi,

Thanks for your response. Unfortunately, that's not what I've asked. I know 
I can filter for the full URL using contains any. My goal is to filter out 
all empty final URLs arrays in the ad_group_criterions. (something like 
CONTAINS ANY ("https") or IS NOT NULL). Apologies for the confusion, tho.

Your query only worked because that's exactly the same URL as the one in 
the array. However, my goal, as per the initial post, is to use CONTAINS 
ANY (or any other operator) to filter out empty values without knowing the 
full list of URLs before (I'd need to query the whole DB to get all of them 
in the first place, process them and just re-run the query, won't make 
sense).

To prove my point, I ran the following query which does not work with your 
CONTAINS ANY simply because there's no ad having that exact same URL.

SELECT customer.resource_name, customer.id, customer.descriptive_name, 
customer.status, campaign.resource_name, campaign.id, campaign.name, 
campaign.status, ad_group.resource_name, ad_group.id, ad_group.name, 
ad_group.status, metrics.impressions, metrics.clicks, metrics.cost_micros, 
metrics.conversions, ad_group_ad.ad.resource_name, ad_group_ad.ad.id, 
ad_group_ad.ad.name, ad_group_ad.status, ad_group_ad.ad.final_urls, 
ad_group_ad.ad.final_mobile_urls FROM ad_group_ad WHERE campaign.status IN 
(ENABLED)  AND ad_group.status IN (ENABLED)  AND segments.date DURING 
YESTERDAY AND metrics.impressions > 1  AND ad_group_ad.ad.final_urls 
 CONTAINS ANY ("https://www.magnolia-cms.com";) PARAMETERS 
omit_unselected_resource_names=true, include_drafts=false

Can you help with that?
Thanks again

On Friday, February 24, 2023 at 7:26:04 PM UTC+2 Google Ads API Forum 
Advisor wrote:

> Hi Andrei,
>
> Thanks for getting back to us.
>
> I’ve tried to filter the sample final url as *https://www.mag**a-cms.com* 
> <https://www.magnolia-cms.com/>*, *and it is showing the correct 
> response. You may see below GAQL where it pulled a successful response.
>
>
> SELECT customer.resource_name, customer.id, customer.descriptive_name, 
> customer.status, campaign.resource_name, campaign.id, campaign.name, 
> campaign.status, ad_group.resource_name, ad_group.id, ad_group.name, 
> ad_group.status, ad_group_criterion.resource_name, 
> ad_group_criterion.criterion_id, ad_group_criterion.display_name, 
> ad_group_criterion.status, ad_group_criterion.final_urls, 
> ad_group_criterion.final_mobile_urls, campaign.url_expansion_opt_out, 
> metrics.clicks, metrics.cost_micros, metrics.impressions, 
> metrics.conversions FROM keyword_view WHERE campaign.status IN ('ENABLED') 
> AND ad_group.status IN ('PAUSED') AND segments.date DURING LAST_7_DAYS     
> AND ad_group_criterion.final_urls CONTAINS ANY ('
> *https://www.magnolia-cms.com* <https://www.magnolia-cms.com/>')
>
> *Response:*
>
> "results": [
>
>     {
>
>       "customer": {
>
>         "status": "ENABLED",
>
>         "resourceName": "customers/**",
>
>         "descriptiveName": "**",
>
>         "id": "9392902305 <(939)%20290-2305>"
>
>       },
>
>       "adGroup": {
>
>         "status": "PAUSED",
>
>         "resourceName": "customers/**/adGroups/145117578611",
>
>         "id": "145117578611",
>
>         "name": "Gartner - DXP"
>
>       },
>
>       "campaign": {
>
>         "status": "ENABLED",
>
>         "resourceName": "customers/***/campaigns/17866379228 
> <(786)%20637-9228>",
>
>         "name": "TR - SRC - Gartner - WCMS (#gc-gartner)",
>
>         "id": "17866379228 <(786)%20637-9228>"
>
>       },
>
>       "keywordView": {
>
>         "resourceName": "customers/**/keywordViews/145117578611~***"
>
>       },
>
>       "metrics": {
>
>         "conversions": 0,
>
>         "impressions": "0",
>
>         "costMicros": "0",
>
>         "clicks": "0"
>
>       },
>
>       "adGroupCriterion": {
>
>         "status": "ENABLED",
>
>         "resourceName": "customers/9392902305 <(939)%20290-2305>
> /adGroupCriteria/145117578611~320125480291",
>
>         "finalUrls": [
>
>           "*https://www.magnolia-cms.com* <https://www.magnolia-cms.com/>"
>
>         ],
>
>         "displayName": "gartner ***",
>
>         "criterionId": "320****91"
>
>       }
>
>     }
>
>   ],
>
>  
>
> That being said, you may try to add a valid final url that you want to 
> filter and see if it works on your end.
>
>  
>
> Regards,
> [image: Google Logo] Google Ads API Team 
>
> ref:_00D1U1174p._5004Q2j24OS:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/e574ce28-e623-429b-859d-478a93ed92e3n%40googlegroups.com.

Reply via email to