Unable to mutate ProductPartitions for AdGroup

370 views
Skip to first unread message

Михаил Бесчетнов

unread,
Mar 5, 2015, 9:56:05 AM3/5/15
to adwor...@googlegroups.com
Hello!

There is an issue with adding a ProductPartition list for AdGroup.

I'm trying to add new ProductPartition to existing root partition, which is now empty:

AdGroupCriterionServiceInterface adGroupCriterionService = new AdWordsServices().get(adWordsSession, AdGroupCriterionServiceInterface.class);

ProductPartitionTree partitionTree = ProductPartitionTree.createAdGroupTree(new AdWordsServices(), adWordsSession, request.getAdGroupId());

ProductPartitionNode rootNode = partitionTree.getRoot().asSubdivision();

rootNode
.addChild(
     
ProductDimensions.createCanonicalCondition(ProductCanonicalConditionCondition.NEW)
).asBiddableUnit().setBid(100000L);

rootNode
.addChild(
     
ProductDimensions.createCanonicalCondition(null)
).asSubdivision();

List<AdGroupCriterionOperation> mutateOperations = partitionTree.getMutateOperations();

if (mutateOperations.isEmpty()) {
   
System.out.println("Nothing to do");
} else {
   adGroupCriterionService
.mutate(
         mutateOperations
.toArray(
               
new AdGroupCriterionOperation[mutateOperations.size()]
         
)
   
);
}

It looks just like in example (https://github.com/googleads/googleads-java-lib/blob/master/examples/adwords_axis/src/main/java/adwords/axis/v201409/shoppingcampaigns/AddProductPartitionTree.java), but in my case server returns:

[AdGroupCriterionError.PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE @ operations; trigger:'ProductPartition{id=TempCriterionId{id=1}, bidSimulatorStatus=null, partitionType=SUBDIVISION, parentCriterionId=null, productGroup=null, caseValue=null, decisionPath=[]}']

What is wrong? :)

Josh Radcliff (AdWords API Team)

unread,
Mar 5, 2015, 1:59:50 PM3/5/15
to adwor...@googlegroups.com
Hi,

The problem is that your "other" node is a SUBDIVISION node, but it needs to be a UNIT node.

Here's what you are attempting to create:
  • root, type = SUBDIVISION
    • CanonicalCondition=NEW, type = UNIT
    • CanonicalCondition=null, type = SUBDIVISION

To fix this, you can either:

a) make the "other" node an excluded unit node

rootNode.addChild(ProductDimensions.createCanonicalCondition(null))
  .asExcludedUnit();

OR

b) make the "other" node a biddable unit node with a bid.

rootNode.addChild(ProductDimensions.createCanonicalCondition(null))
  .asBiddableUnit().setBid(...); // replace ... with your bid amount in micros

Thanks,
Josh, AdWords API Team

Михаил Бесчетнов

unread,
Mar 6, 2015, 7:13:57 AM3/6/15
to adwor...@googlegroups.com
Thank you!
Reply all
Reply to author
Forward
0 new messages