Error trying to get metrics.phone_calls for customer

77 views
Skip to first unread message

JP Boily

unread,
Apr 26, 2023, 7:23:00 PM4/26/23
to Google Ads API and AdWords API Forum
Hey folks,

We're trying to fetch the number of phone calls (metrics.phone_calls) on a customer level with this query:

```
SELECT
  metrics.phone_calls
FROM customer
WHERE segments.date >= '2021-01-01'
  AND segments.date <= '2023-01-28'
```

We're getting this error:

 {"error"=>{"code"=>400, "message"=>"Request contains an invalid argument.", "status"=>"INVALID_ARGUMENT", "details"=>[{"@type"=>"type.googleapis.com/google.ads.googleads.v13.errors.GoogleAdsFailure", "errors"=>[{"errorCode"=>{"queryError"=>"PROHIBITED_METRIC_IN_SELECT_OR_WHERE_CLAUSE"}, "message"=>"Cannot select or filter on the following metrics: 'phone_calls'(could not support requested resources: 'CUSTOMER'), since metric is incompatible with the resource in the FROM clause or other selected segmenting resources."}], "requestId"=>"HIDDEN_FOR_YOU_FOLKS"}]}}

But it should work, according to the doc:

Screenshot 2023-04-26 at 7.21.39 PM.png

Which one is wrong, and which one is right?

I guess there is always the workaround of getting it on the campaign level and adding them all, but it's not ideal, if it should be supported anyways.

Thanks! :)

Google Ads API Forum Advisor

unread,
Apr 27, 2023, 5:03:29 AM4/27/23
to j...@metrics.watch, adwor...@googlegroups.com
Hi,

Thank you for raising this concern to the Google Ads API support team.

Regarding your concern, please note that the metrics.phone_calls is not a compatible/selectable metric for the customer report and this is the reason why you are getting the said error. Kindly note that for you to know what fields that are compatible or selectable to a specific report, you will need to select the 'Yes it is' option in the dropdown of a specific report. I would suggest using the customer_query_builder (https://developers.google.com/google-ads/api/fields/v13/customer_query_builder) as this will greatly help you build and validate your query.

Let us know if you have further questions.

Regards,
Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2kqou6:ref

JP Boily

unread,
Apr 27, 2023, 9:24:58 AM4/27/23
to Google Ads API and AdWords API Forum
You should update your doc then, as it's shown as Selectable in the doc in the Customer. :)

But thanks for the confirmation!

Google Ads API Forum Advisor

unread,
Apr 27, 2023, 12:33:40 PM4/27/23
to j...@metrics.watch, adwor...@googlegroups.com

Hi,

Thank you for your feedback.

Our documentation (https://developers.google.com/google-ads/api/fields/v13/customer) for customer report states that it will show all metrics and segments that can be put in the same SELECT clause as the fields of customer. However, when you specify customer in the FROM clause, some metrics and segments cannot be used. 

If you use the filter for this report, then you will verify that metrics.phone_calls cannot be used in customer report if you select the "Yes, it is" option for the question "Is customer specified in the FROM clause of your query?".

If you have any other concerns with Google Ads API, feel free to reach out to us once again with the details so we can further investigate.

Regards,

Reply all
Reply to author
Forward
0 new messages