$label_id = TempIdGenerator::Generate(); $keyword_label = new TextLabel(); $keyword_label->setId($label_id); $keyword_label->setName($label_text); $keyword_label->setAttribute('test');
$label_operation = new LabelOperation(); // Label operation should not be included in the BatchJobService $label_operation->setOperand($keyword_label); $label_operation->setOperator('ADD');
$adwords_services = new AdWordsServices(); $label_service = $adwords_services->get($session, LabelService::class); $result = $label_service->mutate(array($label_operation));
$adgroup_criterion = new AdGroupCriterion(); $adgroup_criterion->setLabels(array(new AdGroupCriterionLabel($adgroup_id, $keyword_id, $label_id)));
$operation = new AdGroupCriterionLabelOperation(); $operation->setOperand($adgroup_criterion); $operation->setOperator('ADD');
return $operation;
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201806"><rval><errorList><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError"><fieldPath>operations[0].operand.adGroupId</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>adGroupId</field></fieldPathElements><trigger/><errorString>RequiredError.REQUIRED</errorString><ApiError.Type>RequiredError</ApiError.Type><reason>REQUIRED</reason></errors><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError"><fieldPath>operations[0].operand.criterionId</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>criterionId</field></fieldPathElements><trigger/><errorString>RequiredError.REQUIRED</errorString><ApiError.Type>RequiredError</ApiError.Type><reason>REQUIRED</reason></errors><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError"><fieldPath>operations[0].operand.labelId</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>labelId</field></fieldPathElements><trigger/><errorString>RequiredError.REQUIRED</errorString><ApiError.Type>RequiredError</ApiError.Type><reason>REQUIRED</reason></errors><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError"><fieldPath>operations[0].operand.labelId</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>labelId</field></fieldPathElements><trigger/><errorString>RequiredError.REQUIRED</errorString><ApiError.Type>RequiredError</ApiError.Type><reason>REQUIRED</reason></errors><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError"><fieldPath>operations[0].operand.criterionId</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>criterionId</field></fieldPathElements><trigger/><errorString>RequiredError.REQUIRED</errorString><ApiError.Type>RequiredError</ApiError.Type><reason>REQUIRED</reason></errors><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError"><fieldPath>operations[0].operand.adGroupId</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>adGroupId</field></fieldPathElements><trigger/><errorString>RequiredError.REQUIRED</errorString><ApiError.Type>RequiredError</ApiError.Type><reason>REQUIRED</reason></errors></errorList><index>0</index></rval></mutateResponse>