CONTAINS ANY + ad_group_criterion_final_urls does not work as expected.

70 views
Skip to first unread message

Andrei Crișan

unread,
Feb 20, 2023, 7:48:21 AM2/20/23
to Google Ads API and AdWords API Forum
Hi all,

I'm facing an issue I didn't have with the previous Google AdWords API, the fact that I can not filter a query by the ad_group_criterion_final_urls list being non-empty. I read another post from the forum, but no solution has been provided there niether.

My goal: getting all the keywords with non-empty final_urls array 
My query is the following:

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")
   
PARAMETERS omit_unselected_resource_names=true, include_drafts=false


The issue being the bolded WHERE condition. I expect that to return all the final_urls containing at least one element that contains https. I tried multiple characters and combinations for CONTAINS NONE/CONTAINS ANY/CONTAINS ALL but none seems to be working in the way I expect it to do it. (eg. CONTAINS ALL (".") should return all final_urls contains a dot character).

The response is successful, but it does not filter for the final_urls. Can you help with this? Thanks.

Google Ads API Forum Advisor

unread,
Feb 20, 2023, 5:41:18 PM2/20/23
to and...@zarbi.ro, adwor...@googlegroups.com

Hi Andrei, 

Thanks for reaching out to the Google Ads API Team. I hope you are doing well today.

Thank you for providing a sample query. With regards to your concern about “getting all the keywords with non-empty final_urls array but d_group_criterion_final_urls does not work as expected”, for our team to further compare, investigate, validate and can provide a right recommendation for you, could you please provide us with the complete logs (request and response with request-id) generated on your end?

Also, we recommend that you enable logging to capture complete details by navigating to the Client libraries > Your client library (ex Python) > Logging documentation, which you can access from this link

For REST interface requests, you can enable logging via the curl command by using the -i flag. This will cause the tool to include the HTTP response headers in the output.

You may then send the requested information via the Reply privately to the author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

In addition, you may validate your query here for keyword_view and for url reports, see here.

Have a great day.

Regards,

Google Logo
Marjorie
Google Ads API Team
 


ref:_00D1U1174p._5004Q2j24OS:ref

Andrei Crișan

unread,
Feb 24, 2023, 6:04:51 AM2/24/23
to Google Ads API and AdWords API Forum
Hi,

I've sent a private message but not sure if you got it. Thanks

Google Ads API Forum Advisor

unread,
Feb 24, 2023, 12:26:04 PM2/24/23
to and...@zarbi.ro, adwor...@googlegroups.com

Hi Andrei,

Thanks for getting back to us.

I’ve tried to filter the sample final url as https://www.mag**a-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')

Response:

"results": [

    {

      "customer": {

        "status": "ENABLED",

        "resourceName": "customers/**",

        "descriptiveName": "**",

        "id": "9392902305"

      },

      "adGroup": {

        "status": "PAUSED",

        "resourceName": "customers/**/adGroups/145117578611",

        "id": "145117578611",

        "name": "Gartner - DXP"

      },

      "campaign": {

        "status": "ENABLED",

        "resourceName": "customers/***/campaigns/17866379228",

        "name": "TR - SRC - Gartner - WCMS (#gc-gartner)",

        "id": "17866379228"

      },

      "keywordView": {

        "resourceName": "customers/**/keywordViews/145117578611~***"

      },

      "metrics": {

        "conversions": 0,

        "impressions": "0",

        "costMicros": "0",

        "clicks": "0"

      },

      "adGroupCriterion": {

        "status": "ENABLED",

        "resourceName": "customers/9392902305/adGroupCriteria/145117578611~320125480291",

        "finalUrls": [

          "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,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2j24OS:ref
Message has been deleted

Google Ads API Forum Advisor

unread,
Mar 1, 2023, 2:07:03 AM3/1/23
to and...@zarbi.ro, adwor...@googlegroups.com
Hi Andrei,

Thank you for your clarification. Allow me to raise this "filter out all empty final URLs arrays in the ad_group_criterions" as a feature request, subject for a review. For now, you may please keep an eye on our blog post and to the Release Notes in Google Ads API for updates or announcements when it becomes available.

Best regards,
Reply all
Reply to author
Forward
0 new messages