Search code examples
google-ads-apigoogle-ads-script

CampaignName CONTAINS_ALL ['test', 'play'] Invalid or inapplicable operator is used for field CampaignName


I have followed the syntax from this doc

withCondition("ColumnName IN [Value1, Value2]")

But I get an error when running this piece of code:

  var adGroups = AdsApp
    .adGroups()
    .withCondition(agName)
    .withCondition(campName)
    .get();

Error:

5/25/2021 9:32:53 PM    CampaignName CONTAINS_ALL ['test', 'play']
5/25/2021 9:32:54 PM    Invalid or inapplicable operator is used for field CampaignName. Please check the supported operators. (file Code.gs, line 52)

Solution

  • CampaignName is of string values, so it can use a chained CONTAINS_IGNORE_CASEcondition.