Getting INVALID_PRODUCT_PARTITION_HIERARCHY when updating partition

116 views
Skip to first unread message

artem baltser

unread,
Sep 24, 2019, 12:16:34 AM9/24/19
to AdWords API and Google Ads API Forum
Hi. Im trying to update product group with java api( product partition tree) so It creates 2 operations for one partition. For example, product 'X' is excluded couple hours ago. Im setting this as 'biddable'.
Mutation returns  INVALID_PRODUCT_PARTITION_HIERARCHY error. I can't figure out  what's wrong

Code:

 
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 ;
}


Google Ads API Forum Advisor Prod

unread,
Sep 24, 2019, 2:03:51 AM9/24/19
to adwor...@googlegroups.com

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



ref:_00D1U1174p._5001UHHjTF:ref

artem baltser

unread,
Sep 24, 2019, 12:54:38 PM9/24/19
to AdWords API and Google Ads API Forum
Hi, actually It happens when I get operations from tree: remove & add, but It's in a single mutation request. I guess It should be divided by 2 separated api requests? 

artem baltser

unread,
Sep 24, 2019, 2:09:18 PM9/24/19
to AdWords API and Google Ads API Forum
I can't remove excluded partition. Im getting AdGroupCriterionError{apiErrorType=AdGroupCriterionError, errorString=AdGroupCriterionError.CAMPAIGN_TYPE_NOT_COMPATIBLE_WITH_PARTIAL_FAILURE, fieldPath=operations[0].operand, fieldPathElements=[FieldPathElement{field=operations, index=0}, FieldPathElement{field=operand}], reason=CAMPAIGN_TYPE_NOT_COMPATIBLE_WITH_PARTIAL_FAILURE, trigger=SHOPPING}


On Tuesday, 24 September 2019 09:03:51 UTC+3, adsapiforumadvisor wrote:

Google Ads API Forum Advisor Prod

unread,
Sep 24, 2019, 10:58:49 PM9/24/19
to adwor...@googlegroups.com
Hi Artem,

Partial failures are only applicable when making non-structural changes (e.g. bid changes to existing nodes) to your ProductPartitions as stated here. If you wish to make a REMOVE operation for the partition, you would need to disable the partialFailures for that request to avoid this (CAMPAIGN_TYPE_NOT_COMPATIBLE_WITH_PARTIAL_FAILURE) error.
Reply all
Reply to author
Forward
0 new messages