How to query WHERE cost > X ?

58 views
Skip to first unread message

EladB

unread,
Mar 5, 2022, 10:37:50 AM3/5/22
to Google Ads API and AdWords API Forum
Hi Google Support,

I've run into an issue with the Google Ads Query Validator and need some help debugging.

  * API Version: v10

  * Query: "SELECT customer.id, metrics.impressions FROM group_placement_view WHERE group_placement_view.placement_type IN ("YOUTUBE_CHANNEL") AND (metrics.impressions + metrics.average_cpm) > 1000000"

  * Result: Invalid Query (errors below)

    * The filtering condition '(metrics.impressions + metrics.average_cpm) > 1000000' in the WHERE clause is not valid. Filtering conditions must take the form of 'field operator operand'. The operators IS NULL and IS NOT NULL take no operand.

  * Link to query result: https://gaql-query-builder.uc.r.appspot.com/v10/share?q=SELECT%20customer.id%2C%20metrics.impressions%20FROM%20group_placement_view%20WHERE%20group_placement_view.placement_type%20IN%20(%22YOUTUBE_CHANNEL%22)%20AND%20(metrics.impressions%20%2B%20metrics.average_cpm)%20%3E%201000000

  * Expected result:
Using SQL, I can do arithmetic operations in the "WHERE" clause.
Is This syntax not valid for GAQL?

How can I filter group_placements WHERE the spend is above X ?
There is no metric "spend" or "cost"

I thought to use:
(all_conversions * cost_per_all_conversions)


Thanks!
Reply all
Reply to author
Forward
0 new messages