TopicInfo positive target criteria is giving the error

77 views
Skip to first unread message

Ramesh Kolamala

unread,
Feb 19, 2022, 8:27:29 AM2/19/22
to Google Ads API and AdWords API Forum
I am trying to target a Topic at campaign level, but getting the following error:

My Code:
$topicId = 317;
    
    $campaignCriterion = new CampaignCriterion([
        'topic' => new TopicInfo([
            'topic_constant' => ResourceNames::forTopicConstant($topicId)
        ]),
        'campaign' => $campaignResourceName
    ]);

    $operations[] = new CampaignCriterionOperation(['create' => $campaignCriterion]);
Error:
"errorCode": { "criterionError": "FIELD_INCOMPATIBLE_WITH_NEGATIVE_TARGETING" }, "message": "The field is not allowed to be set when the negative field is set to true, e.g. we don't allow bids in negative ad group or campaign criteria.", "location": { "fieldPathElements": [ { "fieldName": "operations", "index": 0 }, { "fieldName": "create" }, { "fieldName": "topic" } ] }

Google Ads API Forum Advisor

unread,
Feb 21, 2022, 4:17:37 AM2/21/22
to rame...@gmail.com, adwor...@googlegroups.com
Hello Ramesh,

Thank you for reaching out to us. 

With regard to your concern, please do note that new campaign will not contain topic criteria by default and only negative criteria are supported at the campaign level. That said, you need to set the negative field to true.

If you still getting an error, please provide us with the complete request and response logs with the request-id and request header, so our team can better check the root cause of the error. For the client library, logging can be enabled by navigating to the Client libraries > Your client library (ex. PHP) > Logging documentation, which you can access from this link.

Regards,
Google Logo
Teejay Wennie
Google Ads API Team
 


ref:_00D1U1174p._5004Q2WxJBU:ref
Reply all
Reply to author
Forward
0 new messages