AWQL + WHERE + greater_than Percentage

77 views
Skip to first unread message

Stephen Barrett

unread,
May 18, 2018, 4:44:48 PM5/18/18
to AdWords API and Google Ads API Forum
Hi!

I'm trying to pull a Keywords Performance Report to only pull keywords with a CTR that is greater than 3%. 

->from(ReportDefinitionReportType::KEYWORDS_PERFORMANCE_REPORT)
->where('Status')->in(['ENABLED'])
->where('Ctr')->greater_than(['3.00%'])
->duringDateRange(ReportDefinitionDateRangeType::LAST_7_DAYS)

Originally, I did not have that where statement. So it was pulling everything that I had within the last 7 days. So I know the values being pulled in for Ctr were percentages (3.00%) as the value. Do I need the square brackets? Do I need to combine both Where clauses?

Peter Oliquino (AdWords API Team)

unread,
May 21, 2018, 2:48:29 AM5/21/18
to AdWords API and Google Ads API Forum
Hi Stephen,

For your query, you can just use AND to include both filters in one WHERE clause only. Also, you can try and just specify the percentage as '3.00' and you can exclude the brackets when you're not using the IN operator. Let me know if this helps.

Thanks and regards,
Peter
AdWords API Team

Stephen Barrett

unread,
May 21, 2018, 11:57:51 AM5/21/18
to AdWords API and Google Ads API Forum
So it would be something like:

->where('Status')->in(['ENABLED']) AND ('Ctr')->greater_than('3.00')

Peter Oliquino (AdWords API Team)

unread,
May 21, 2018, 11:25:15 PM5/21/18
to AdWords API and Google Ads API Forum
Hi Stephen,

Yes, it should look similar to the snippet you have written. Let me know if that works for you.

Best regards,
Peter
AdWords API Team

Peter Oliquino (AdWords API Team)

unread,
May 22, 2018, 10:59:46 PM5/22/18
to AdWords API and Google Ads API Forum
Hi Stephen,

My apologies if I may have missed that part. For the greater than operator, could you use the '>' symbol instead? You can write it similar to the one below :

AND ('Ctr' > '3.00')

You may also refer to this guide for more information on how to form queries using AWQL.
Reply all
Reply to author
Forward
0 new messages