keyword.ad_group_criterion wrongly being included

169 views
Skip to first unread message

Harsha Nandiwada

unread,
May 6, 2022, 1:14:46 PM5/6/22
to Google Ads API and AdWords API Forum
Hi,
I'm making a query for ad_group_ad and for some reason, the segmentation is including fields I did not query for. Specifically, I'm getting back keyword.ad_group_criterion. 
This is my query:
        SELECT
          ad_group_ad.ad.id,
          ad_group_ad.ad.name,
          ad_group_ad.ad.type,
          ad_group.id,
          ad_group.name,
          ad_group.status,
          ad_group.type,
          campaign.id,
          campaign.name,
          segments.date,
          segments.keyword.info.text,
          metrics.impressions,
          metrics.clicks,
          metrics.conversions,
          metrics.conversions_value,
          metrics.interactions,
          metrics.cost_micros
        FROM ad_group_ad
        WHERE segments.date DURING {'LAST_30_DAYS' if long_lookback else 'TODAY'}
            AND ad_group.type != SHOPPING_SMART_ADS
        ORDER BY segments.date


and this is the first row of my results:
campaign {
  resource_name: "customers/5484439197/campaigns/14042339226"
  name: "Leads-Search-1"
  id: 14042339226
}
ad_group {
  resource_name: "customers/5484439197/adGroups/127758315960"
  status: ENABLED
  type_: SEARCH_STANDARD
  id: 127758315960
  name: "Main_Ad_Group"
}
metrics {
  clicks: 0
  conversions_value: 0.0
  conversions: 0.0
  cost_micros: 0
  impressions: 2
  interactions: 0
}
ad_group_ad {
  resource_name: "customers/5484439197/adGroupAds/127758315960~535905305969"
  ad {
    type_: RESPONSIVE_SEARCH_AD
    resource_name: "customers/5484439197/ads/535905305969"
    id: 535905305969
  }
}
segments {
  keyword {
    info {
      text: "ecommerce metrics"
    }
    ad_group_criterion: "customers/5484439197/adGroupCriteria/127758315960~91570650"
  }
  date: "2022-05-06"
}

Why am I getting this extra segment, and how do I stop getting it? I tried adding the line 
        PARAMETERS omit_unselected_resource_names = true
to the end of the query, but I got this error:
WARNING:google.ads.googleads.client:Request made: ClientCustomerId: 5484439197, Host: googleads.googleapis.com, Method: /google.ads.googleads.v8.services.GoogleAdsService/SearchStream, RequestId: EuINCwMyKDUUzT6xWCTTeA, IsFault: True, FaultMessage: Invalid parameter name cannot be included in PARAMETERS clause: 'omit_unselected_resource_names'.
ERROR:root:Exception: (<_SingleThreadedRendezvous of RPC that terminated with:
        status = StatusCode.INVALID_ARGUMENT
        details = "Request contains an invalid argument."
        debug_error_string = "{"created":"@1651855789.324534000","description":"Error received from peer ipv4:142.250.72.202:443","file":"src/core/lib/surface/call.cc","file_line":1075,"grpc_message":"Request contains an invalid argument.","grpc_status":3}"
>, <_SingleThreadedRendezvous of RPC that terminated with:
        status = StatusCode.INVALID_ARGUMENT
        details = "Request contains an invalid argument."
        debug_error_string = "{"created":"@1651855789.324534000","description":"Error received from peer ipv4:142.250.72.202:443","file":"src/core/lib/surface/call.cc","file_line":1075,"grpc_message":"Request contains an invalid argument.","grpc_status":3}"
>, errors {
  error_code {
    query_error: BAD_PARAMETER_NAME
  }
  message: "Invalid parameter name cannot be included in PARAMETERS clause: \'omit_unselected_resource_names\'."

Harsha Nandiwada

unread,
May 6, 2022, 3:27:25 PM5/6/22
to Google Ads API and AdWords API Forum
Update: upgraded to v10! I added the parameter and it passes validation, but the criterion is still showing up.

Google Ads API Forum Advisor

unread,
May 10, 2022, 2:46:53 AM5/10/22
to har...@trackstarhq.com, adwor...@googlegroups.com
Hi Harsha,

Thank you for reaching out to our API support team.

The behavior you are observing could be related to the implicit segmentation or the segment resources behavior of the Google Ads API's reporting. However, so that I may confirm this with the rest of our team, could you provide as well the complete request and response logs, with the request-id, and login-customer-id, of your v10 request?

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

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


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