Hi, I've been researching this for a few hours now and still can't figure out a solution.
I intend to exclude some content_labels on the campaign level.
At first, I followed the API examples but those are for 'CustomerNegativeCriteria' that are account level settings (sidenote, I couldn't find these global settings on the AdWords interface).
Then I read more and tried to exclude them using a CampaignCriterion
So I'll create my ContentLabel objects in this way:
$criterion = new ContentLabel();
$criterion->setContentLabelType($sLabelType);
$criterion->setType(CriterionType::CONTENT_LABEL);
Then, I will add that modifier to a CampaignCriterion object:
foreach ($aModifiers as $modifier) {
$campaignCriterion = new CampaignCriterion($sCampaignId, $isNegative, $modifier, $bidModifier);
$operation = new CampaignCriterionOperation();
$operation->setOperand($campaignCriterion);
$operation->setOperator($operator);
$operations[] = $operation;
}
And then I'll pass those operations to a CampaignCriterionService
$oCampaignCriterionService = $this->getCampaignCriterionService();
return $oCampaignCriterionService->mutate($operations);
All this is generating this error but I can't find how to solve this. because in the campaign created those values are still in Green (active)
Message: [
CriterionError.CANNOT_TARGET_CRITERION @ operations[0].operand.criterion.contentLabelType; trigger:'DP',
CriterionError.CANNOT_TARGET_CRITERION @ operations[1].operand.criterion.contentLabelType; trigger:'ADULTISH',
CriterionError.CANNOT_TARGET_CRITERION @ operations[2].operand.criterion.contentLabelType; trigger:'JACKASS',
CriterionError.CANNOT_TARGET_CRITERION @ operations[3].operand.criterion.contentLabelType; trigger:'PROFANITY',
CriterionError.CANNOT_TARGET_CRITERION @ operations[4].operand.criterion.contentLabelType; trigger:'TRAGEDY',
CriterionError.CANNOT_TARGET_CRITERION @ operations[5].operand.criterion.contentLabelType; trigger:'VIDEO_RATING_DV_MA'
]
I'm following the tree structure from here but to no avail:
Any idea of what I could be doing wrong?