Conversions value per cost (ROAS) - Cannot select or filter

602 views
Skip to first unread message

Hubert Jaworski

unread,
May 25, 2022, 8:20:08 AM5/25/22
to Google Ads API and AdWords API Forum
Hey there!

I query the Google Ads API for some reporting metrics.
The Campaign Resource DOES list metrics.conversions_value_per_cost as available:

But I get the following error:

error_code {
    query_error: PROHIBITED_METRIC_IN_SELECT_OR_WHERE_CLAUSE
  }
  message: "Cannot select or filter on the following metrics: \'conversions_value_per_cost\'(could not support requested resources: \'CAMPAIGN\'), since metric is incompatible with the resource in the FROM clause or other selected segmenting resources."


Here's the query:
SELECT 
segments.device, 
metrics.impressions, 
metrics.clicks, 
metrics.ctr, 
metrics.average_cpc, 
metrics.cost_micros, 
metrics.conversions, 
metrics.conversions_value, 
metrics.conversions_value_per_cost, 
metrics.conversions_from_interactions_rate, 
metrics.search_impression_share, 
metrics.search_rank_lost_impression_share, metrics.search_budget_lost_impression_share 
FROM campaign 
WHERE segments.date BETWEEN '2022-05-16' AND '2022-05-22' 
AND campaign.advertising_channel_type = 'SEARCH' 
AND campaign.name LIKE "%MyPattern%"

The Google Ads UI does have this metric, so I guess I'm missing something here?


Google Ads API Forum Advisor

unread,
May 26, 2022, 1:48:18 AM5/26/22
to hubertj...@gmail.com, adwor...@googlegroups.com
Hi Hubert,

Thank you for raising your concern to the team.

Upon checking our document, I can see that it should be supported for the said report type. However, you've encountered the error where it says that the field is not compatible with the said report type. Also, I tried it in the query validator and I can see the same error.

With this, so that I can further investigate or raise it to the team, would you be able to provide the complete request and response logs with request ID and request header generated on your end? You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bDLrx:ref

Hubert Jaworski

unread,
May 31, 2022, 8:28:25 AM5/31/22
to Google Ads API and AdWords API Forum
How do I do that in Python?

Here's a snippet of how I use the Python library to send requests to the API:
ga_service = googleads_client.get_service("GoogleAdsService")
search_request = googleads_client.get_type("SearchGoogleAdsStreamRequest")
search_request.customer_id = customer['id']
search_request.query = query
search_request.summary_row_setting = googleads_client.get_type(
'SummaryRowSettingEnum').SummaryRowSetting.SUMMARY_ROW_WITH_RESULTS

stream = ga_service.search_stream(search_request)
for batch in stream:
(...)

Not quite sure how to obtain the complete logs here :(

Google Ads API Forum Advisor

unread,
Jun 1, 2022, 2:34:56 AM6/1/22
to hubertj...@gmail.com, adwor...@googlegroups.com
Hi Hubert,

Thank you for the reply.

For you to check if you have an API logs, note that this can be requested or provided to the developer handling the Google Ads API transactions when logging of the API requests has been enabled.

This is the specific guideline for Python to enable it. 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
Heidi
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bDLrx:ref

Zeyuan Gu

unread,
May 10, 2023, 6:22:05 PM5/10/23
to Google Ads API and AdWords API Forum
Hey, 

Were you able to pull roas (conversion_value_per_cost) from campaigns? 

Google Ads API Forum Advisor

unread,
May 11, 2023, 4:42:45 AM5/11/23
to zeyu...@adzviser.com, adwor...@googlegroups.com

Hi Zeyuan,

Thank you for reaching out to us.

Kindly note that 'metrics.conversions_value_per_cost' is not a valid field in the SELECT clause when 'campaign' is the resource in the FROM clause. Fields in the SELECT must be 'Selectable.

However, to see the attributed resource fields that can be put in the same SELECT clause as the fields of campaign report, you can refer to its query builder. You can freely see the selectable fields in the “Choose a Clause to Select From” section.

I would also recommend that you use the Google Ads Query Builder and Query Validator tools for constructing queries.

You may see the links below for the emphasized words from the above statement:

Best regards,
Google Logo Google Ads API Team


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