CriterionError.CANNOT_ADD_CRITERIA_TYPE - When trying to add negative keywords to campaign

388 views
Skip to first unread message

Jonathan

unread,
Oct 14, 2014, 10:34:45 AM10/14/14
to adwor...@googlegroups.com
Hey everybody

When trying to add negative keywords to campaign i get this error:

=======
    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CriterionError">
                        <fieldPath>operations[0].operand.criterion</fieldPath>
                        <trigger/>
                        <errorString>CriterionError.CANNOT_ADD_CRITERIA_TYPE</errorString>
                        <ApiError.Type>CriterionError</ApiError.Type>
                        <reason>CANNOT_ADD_CRITERIA_TYPE</reason>
                    </errors>
=======

It used to work fine.
This is how i add it: in java,

            Keyword keyword = new Keyword();
            keyword.setText("some text");
            keyword.setMatchType(KeywordMatchType.PHRASE);

            //add the criterion as operation
            CampaignCriterionOperation operation = new CampaignCriterionOperation();
            CampaignCriterion campaignCriterion = new CampaignCriterion();
            campaignCriterion.setCampaignId("some campaign id");
            campaignCriterion.setCriterion(keyword);
           
            operation.setOperand(campaignCriterion);
            operation.setOperator(Operator.ADD);
          
and then using the campaignCriterionService.mutate

i dont understand why it isnt letting this operation go thru, how come CANNOT_ADD_CRITERIA_TYPE is the error?
as i mentiond - this used to work for me before...

Thanks alot for any help!


Michael Cloonan (AdWords API Team)

unread,
Oct 14, 2014, 3:57:42 PM10/14/14
to adwor...@googlegroups.com
Hello,

Looking at your code snippet, it appears that you're adding a CampaignCriterion rather than a NegativeCampaignCriterion. Keyword criteria are not supported at the campaign level except in NegativeCampaignCriterion. Try making a NegativeCampaignCriterion instead and see if that helps resolve the issue.

Regards,
Mike, AdWords API Team
Reply all
Reply to author
Forward
0 new messages