Using OR Operator in GAQL Query

272 views
Skip to first unread message

Cantare John

unread,
Aug 1, 2024, 9:27:44 AM8/1/24
to Google Ads API and AdWords API Forum

Hello Google Ads API Community,

I am working on a GAQL query and need to include an OR condition in the WHERE clause. My query looks like this:

SELECT
  search_term_view.resource_name,
  campaign.id,
  metrics.clicks,
  metrics.conversions,
FROM
  search_term_view
WHERE
  campaign.id IN ('xxxxxxxxx')
  AND segments.date = '2024-01-01'
  AND (metrics.clicks > 0 OR metrics.conversions > 0)

However, I am receiving an error indicating that the query is not valid. I want to confirm if using the OR operator in the WHERE clause is supported in GAQL, and if so, what the correct syntax would be.

Is it possible to use the OR operator in a GAQL query? If so, can you provide guidance or examples on the correct usage?

Thank you for your assistance!



Google Ads API Forum Advisor

unread,
Aug 1, 2024, 2:22:46 PM8/1/24
to jo...@paperclicks.net, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

I would like to inform you that 'OR' operator is not supported in GAQL query. I would recommend that you refer to GAQL Grammar and Query Structure guides for more information.

Hope this helps. If you have any more queries, please feel free to get back to us.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vEPI3:ref" (ADR-00260497)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Reply all
Reply to author
Forward
0 new messages