ProductPartitionNode rootNode = partitionTree.getRoot(); ProductPartitionNode productNode = rootNode.getChild(new ProductOfferId(null, itemId));
/* if (productNode.isBiddableUnit())
productNode.setBid((long) (maxCPC * MICROS_PER_DOLLAR));
*/
Iterable<ProductPartitionNode> children = productNode.getChildren();
if (children.iterator().hasNext()) {
log.info("Product Node Type '" + itemId + "' cannot be changed because has child nodes.");
continue;
}
if(productNode.isSubdivision()){
log.info("Product Node Type '" + itemId + "' cannot be changed because its subdivision.");
continue;
}
switch (productGroupType) {
case EXCLUDED:
if (productNode.getParent() == null) {
log.info("Product Node Type '" + itemId + "' cannot be changed to excluded because has not parent node.");
break;
}
productNode.asExcludedUnit();
break;
case BIDDABLE:
productNode.asBiddableUnit();
productNode.setBid((long) (maxCPC * MICROS_PER_DOLLAR));
break out ;
}
Hi Artem,
If a partition tree has already been created as biddable, you would not be able to directly convert it or any of its subdivisions/units to be excluded. You will first need to REMOVE the BiddableAdGroupCriterion and afterwards ADD a new NegativeAdGroupCriterion then associate your ProductPartition, all this using the AdGroupCriterionService.
I hope this has been helpful.
Thanks and regards,
Peter
Google Ads API Team