AWQL: Error in Where statement trying to filter CAMPAIGN_PERFORMANCE_REPORT by Label

224 views
Skip to first unread message

Alberto Esteves Correia

unread,
Mar 19, 2017, 10:23:35 PM3/19/17
to AdWords API Forum
Hi everyone,

I'm testing how to select some metrics from CAMPAIGN_PERFORMANCE_REPORT filtering by Label. But I'm going crazy with that:

select
Labels, LabelIds
from CAMPAIGN_PERFORMANCE_REPORT
where Labels CONTAINS "Name of Label"
during LAST_7_DAYS

I've tried the where clause with all of these variants:

where Labels CONTAINS "Name of Label"
where Labels CONTAINS ["Name of Label"]
where Labels CONTAINS 'Name of Label'
where Labels CONTAINS '"Name of Label"'
where Labels CONTAINS '["Name of Label"]'

The same with = and CONTAINS_IGNORE_CASE operators

Furthermore, I've tried in this other way:


where "Name of Label" IN Labels
where ["Name of Label"] IN Labels
where 'Name of Label' IN Labels
where '"Name of Label"' IN Labels
where '["Name of Label"]' IN Labels

But none of these options worked.

On the other hand, I have coded a MCC script where filtered MCC accounts by Label Name in this way: 


var mccLabelText = "Name of Label";
var accountIterator = MccApp.accounts().withCondition("LabelNames CONTAINS '" + mccLabelText +"'").orderBy('Name').get();

and it worked! 


Any ideas?


Thousands of Thanks!

Peter Oliquino

unread,
Mar 19, 2017, 11:08:29 PM3/19/17
to AdWords API Forum
Hi Alberto,

You seem to be using the AdWords Scripts for generating your reports. I would recommend that you get in touch with their team via the AdWords Scripts Forum.

Best regards,
Peter
AdWords API Team

Ransom Averitt

unread,
Mar 9, 2018, 4:03:38 PM3/9/18
to AdWords API Forum
I am running into the same issue as Alberto. I am trying to use:

WHERE Labels CONTAINS_IGNORE_CASE "my_text"

and I receive the following error:

AdWordsReportBadRequestError: Type: SelectorError.INVALID_PREDICATE_OPERATOR
Trigger: Labels
Field Path: selector.reportDefinition.selector

I have tried all of the permutations listed by Alberto. I tried the same filter on CampaignName and it worked. Are Labels not filterable by text strings using CONTAINS_* anymore?

using api v201710

Peter Oliquino

unread,
Mar 12, 2018, 12:49:59 AM3/12/18
to AdWords API Forum
Hi,

You should be able to filter your report using the Labels fields as seen in its field attributes in the Campaign Performance Report. However, seeing that this is already quite an old thread, I would recommend that you create a new one for better tracking.

Also, you may include the complete report definition so our team could better look into the issue you are currently encountering.
Reply all
Reply to author
Forward
0 new messages