Impossible to segment or where with segments.date in asset_group

35 views
Skip to first unread message

Iván López

unread,
Jun 13, 2024, 11:00:01 AM6/13/24
to Google Ads API and AdWords API Forum
Hi,

I have encountered an strange problem while trying to do a query to the "asset_group" report. As I can see in the documentation, "segments.date" is compatible with resource "asset_group" since you can find it in the segments documentation:
Captura de pantalla 2024-06-13 a las 16.52.28.png
And also, the segments.date appears in de asset_group documentation too:
Captura de pantalla 2024-06-13 a las 16.53.50.png

So I cannot understand why, when I tried to do the following query:
SELECT
    metrics.revenue_micros,
    metrics.conversions_value,
    metrics.impressions,
    metrics.conversions,
    metrics.clicks,
    metrics.cost_micros,
    metrics.interactions,
    metrics.all_conversions_value,
    metrics.all_conversions,
    campaign.url_custom_parameters,
    campaign.advertising_channel_type,
    campaign.tracking_url_template,
    campaign.labels, campaign.id,
    campaign.final_url_suffix,
    asset_group.path2,
    asset_group.path1,
    asset_group.name,
    asset_group.id,
    asset_group.final_urls,
    asset_group.final_mobile_urls,
    asset_group.ad_strength,
campaign.advertising_channel_sub_type
FROM
    asset_group
WHERE
    segments.date BETWEEN 20240613 and 20240613


The response is an error that says segments.date is incompatible with asset_group:
(<_InactiveRpcError of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Request contains an invalid argument."
debug_error_string = "UNKNOWN:Error received from peer ipv6:%5B2a00:1450:4003:800::200a%5D:443 {grpc_message:"Request contains an invalid argument.", grpc_status:3, created_time:"2024-06-13T14:56:20.664649+00:00"}"
>, <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Request contains an invalid argument."
debug_error_string = "UNKNOWN:Error received from peer ipv6:%5B2a00:1450:4003:800::200a%5D:443 {grpc_message:"Request contains an invalid argument.", grpc_status:3, created_time:"2024-06-13T14:56:20.664649+00:00"}"
>, errors {
  error_code {
    query_error: PROHIBITED_SEGMENT_IN_SELECT_OR_WHERE_CLAUSE
  }
  message: "Cannot select or filter on the following segments: \'segments.date\'(could not support requested resources: \'ASSET_GROUP\'), since segment is incompatible with the resource in the FROM clause or other selected segmenting resources."
}
request_id: "VVZtDq_tQ-Rh7VjkgJlOJQ"
, 'VVZtDq_tQ-Rh7VjkgJlOJQ')


I have also tried to do the query simpler with:
SELECT  
    metrics.cost_micros,
    asset_group.name,
    asset_group.id,
campaign.advertising_channel_sub_type
FROM
    asset_group
WHERE
    segments.date BETWEEN 20240613 and 20240613


But the response is the same error. It does not make sense with the documentation.

Could you please help me with this issue?

Thanks,

Iván

Google Ads API Forum Advisor

unread,
Jun 13, 2024, 4:40:51 PM6/13/24
to ivan....@tidart.com, adwor...@googlegroups.com
Hi,

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

Kindly note that we tried to replicate the issue at our end but we are getting the successful run on the provided query with the latest version for the asset group with the date segmentation. Could you confirm whether you are using the latest version of the Google Ads API. If not, I would recommend migrating to the latest version v17, please follow this guide to upgrade to the latest version. If the issue still persists provide us with the complete API logs (request and response with request-id and request header) generated at your end and the entire UI screenshot to better assist you.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.

This message is in relation to case "ref:!00D1U01174p.!5004Q02tJK9k:ref" (ADR-00240704)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!


Iván López

unread,
Jun 14, 2024, 5:23:20 AM6/14/24
to Google Ads API and AdWords API Forum
Yes! You are right, I was trying it with the previous version and I didn't notice that could be the point from the documentation.

It works fine with v17.

Thank you very much!

Ivan

Reply all
Reply to author
Forward
0 new messages