We're tried with two different queries. 1. Segments fields with other unsupported metrics URL : https://googleads.googleapis.com/v16/customers/{customer_id} /googleAds:searchStream Query param : "SELECT campaign.name, campaign.id, campaign.status, metrics.average_cost, metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc, metrics.interaction_rate, metrics.interactions, metrics.all_conversions_value, metrics.all_conversions, metrics.cost_micros, metrics.conversions, metrics.average_cpm, metrics.engagement_rate, metrics.engagements, metrics.video_views, metrics.average_cpv, campaign.campaign_budget, segments.conversion_action_category FROM campaign WHERE segments.conversion_action_category = 'PURCHASE' AND segments.date DURING THIS_MONTH";
Response: [image: image_2024_06_06T07_39_11_177Z.png] 2. Only Segments without unsupported metrics URL : https://googleads.googleapis.com/v16/customers/{customer_id} /googleAds:searchStream Query param : "SELECT metrics.all_conversions_value, segments.conversion_action_category, metrics.all_conversions FROM campaign WHERE segments.conversion_action_category = 'PURCHASE'" AND segments.date DURING THIS_MONTH" Response: [image: image (2).png] We need segments.conversion_action_category together with the campaign metrics like metrics.clicks, metrics.impressions, metrics.ctr, metrics.average_cpc etc. Provide the appropriate solution for this. Thanks On Thursday, June 6, 2024 at 7:19:09 AM UTC+5:30 Google Ads API Forum Advisor wrote: > Hi, > > Thank you for reaching out to the Google Ads API support team. > > Please be informed that I have removed your response from the forums as it > contains the PII information. > > I see that you have already raised this concern on another thread with the > subject 'Google Ads Campaign API error', and we have already responded > there for this issue. To avoid multiple threads on the same issue, please > take a look at that thread and continue the discussion on the same for > further updates on the issue. > > However, I am posting the response again here: > > The PROHIBITED_SEGMENT_WITH_METRIC_IN_SELECT_OR_WHERE_CLAUSE > <https://developers.google.com/google-ads/api/reference/rpc/v13/QueryErrorEnum.QueryError#prohibited_metric_in_select_or_where_clause> > is > encountered because a segment may have been included together with a metric > that it is incompatible with in the SELECT or WHERE clause. For more > information, you may see this document about segmentation > <https://developers.google.com/google-ads/api/docs/reporting/segmentation> > . > > With this, we verified the provided GAQL query and found that you are > mentioning a few incompatible fields (metrics.average_cost, metrics.clicks, > metrics.impressions, etc.) with segments.conversion_action_category. So > remove these incompatible fields in the select clause and try again. > > I highly recommend you utilize the Google Ads Query Builder > <https://developers.google.com/google-ads/api/fields/v16/overview_query_builder> > and Query Validator > <https://developers.google.com/google-ads/api/fields/v16/query_validator> to > build and validate the queries before hitting the API. > > I hope it helps. Please get back to us if you have any further questions > or concerns related to the Google Ads API > <https://developers.google.com/google-ads/api/docs/start>. > > This message is in relation to case > "ref:!00D1U01174p.!5004Q02tJEHi:ref" (ADR-00238567) > > Thanks, > > [image: Google Logo] Google Ads API Team > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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/a9a70019-9aa8-4835-a865-89123c653f10n%40googlegroups.com.