AWQL : how to use CampaignStatus, ORDER BY and LIMIT to retrieve formated datas ?

383 views
Skip to first unread message

Vincent Pélage

unread,
Nov 13, 2017, 6:14:10 PM11/13/17
to AdWords API Forum
Hi,

I'm using https://www.awql.me to build request and the first one below works, I'm successfully able to retrieve all campaigns with datas from past 7 days :

SELECT CampaignId, CampaignName, Clicks, Impressions
FROM CAMPAIGN_PERFORMANCE_REPORT
DURING LAST_7_DAYS

But when I try to add CampaignStatus and/or ORDER BY and/or LIMIT, I've got the following error message :
Underlying errors are <br />Type = 'QueryError.LIMIT_CLAUSE_NOT_SUPPORTED', Trigger = '', FieldPath = ''

There is below the request that cause the issue (I also tried to just use CampaignStatus,  ORDER BY and LIMIT separately but the same error occured) :

SELECT CampaignId, CampaignName, Clicks, Impressions
FROM CAMPAIGN_PERFORMANCE_REPORT
WHERE CampaignStatus = 'Enabled'
DURING LAST_7_DAYS
ORDER BY Clicks DESC
LIMIT 0,5

I read that it's not possible to use ORDER BY and LIMIT with CAMPAIGN_PERFORMANCE_REPORT, so how do you guys get around this limitation to retrieve formated datas in the response, at a campaigns level ?
Did you find a way to make the status works in your AWQL request ?

Thanks a lot !

Vincent

Peter Oliquino

unread,
Nov 14, 2017, 2:01:39 AM11/14/17
to AdWords API Forum
Hi Vincent,

Yes, the ORDER BY and LIMIT are currently not supported in the AdWords API reports as discussed here. Additionally, there is currently no workaround via the AdWords API for this and you may have to implement sorting only at your end.

As for filtering using the CampaignStatus field, you may refer to my sample query below :

SELECT CampaignId, CampaignName, Clicks, Impressions
FROM CAMPAIGN_PERFORMANCE_REPORT
WHERE CampaignStatus = ENABLED
DURING LAST_7_DAYS

I hope this helps. 

Thanks and regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages