Hi,

We  are retrieving our campaigns data from the Google Ads API: Clicks, 
Costs, Impressions etc. by campaign.

I want to add a filter on segment.conversion_action_category = 'PURCHASE' 
also want to add segmenets.conversion_action_category to restrict the 
results only on purchases. But I receive the following error message. 

[
  {
    "error": {
      "code": 400,
      "message": "Request contains an invalid argument.",
      "status": "INVALID_ARGUMENT",
      "details": [
        {
          "@type": 
"type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure",
          "errors": [
            {
              "errorCode": {
                "queryError": 
"PROHIBITED_SEGMENT_WITH_METRIC_IN_SELECT_OR_WHERE_CLAUSE"
              },
              "message": "Cannot select the following segments because at 
least one unsupported metric is found in SELECT or WHERE clause: 
'segments.conversion_action_category'(unsupported metrics: 'average_cost', 
'average_cpc', 'average_cpm', 'average_cpv', 'clicks', 'cost_micros', 
'ctr', 'engagement_rate', 'engagements', 'impressions', 'interaction_rate', 
'interactions', 'video_views')."
            }
          ],
          "requestId": "rQO8VTamZhO8sXdNNOzKsg"
        }
      ]
    }
  }
]

Below is the URL endpoint and Query we're using,

URL : 
https://googleads.googleapis.com/v16/customers/7731521629/googleAds:searchStream

ParamQuery : 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

Suggest the possible solution for this issue.


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/2afcc377-1ff4-467b-8ed9-5dc48b03a5c3n%40googlegroups.com.

Reply via email to