AWQL -- query only Records with Impressions, Clicks, or Conversions > 0

184 views
Skip to first unread message

Brandon Patrick

unread,
Jan 10, 2014, 2:39:40 PM1/10/14
to adwor...@googlegroups.com
Using reporting, I only want to pull ads where one of these stats -- Impressions, Clicks, Conversions -- is greater than zero. In MySQL I would do something like this:

SELECT Id, Impressions, Clicks, Conversions, Status FROM AD_PERFORMANCE_REPORT WHERE CampaignId = $remote_service_ID AND (Impressions > 0 OR Clicks > 0 OR Conversions > 0) DURING $dateRange

But as far as I can tell there is no support for "OR" in AWQL. Can you recommend a way to do this?

Thanks,
Brandon

Brandon Patrick

unread,
Jan 13, 2014, 11:19:48 AM1/13/14
to adwor...@googlegroups.com
I finally realized for my specific case, I only need "Impressions > 0", because my ads will not have Clicks or Conversions if they don't have any Impressions. Duh.

I'd still be interested to know whether there is an OR keyword in AWQL at all. So far it does not seem so.

Rasmus Ladekjær Pedersen

unread,
Jan 14, 2014, 4:19:24 AM1/14/14
to adwor...@googlegroups.com
You can see the formal grammar here https://developers.google.com/adwords/api/docs/guides/awql under Formal Grammar. There is no support for OR i AWQL.

A solution could be to use node-gawr to fetch the data and then filter with grep (on Linux/Mac OS X) or String-Select (on Windows (PowerShell)).
Reply all
Reply to author
Forward
0 new messages