Wonderful and Respectful, this worked for now :)
Now I want to create one more level of SubDivision on the same.
For example:
1. Split childBiddableAdGroupCriterion into 2 Units again, one will have
CUSTOM_ATTRIBUTE_1 as "someValue2" and Everything Else.
This Means I want All products which have CUSTOM_ATTRIBUTE_1 as
"someValue2" AND CUSTOM_ATTRIBUTE_0 as "someValue1"
OR
2. Split childNegativeAdGroupCriterion into 2 Units again, one will have
CUSTOM_ATTRIBUTE_1 as "someValue" and Everything Else.
This Means I want All products which have CUSTOM_ATTRIBUTE_1 as
"someValue2" AND does not have CUSTOM_ATTRIBUTE_0 as "someValue1"
3. How to do above Operations in this campaign by replacing Whole Product
Partition Entities with Entirely new Product Partition Entities.
On Saturday, May 2, 2020 at 5:24:52 AM UTC+5:30, adsapiforumadvisor wrote:
>
> Hi Gagan,
>
> The PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE error will occur if
> the *only* node you create is the root node. If instead you create the
> root node (without a *caseValue*) and its children all in the *same
> mutate request* (as shown below), then the request should succeed.
>
> // Create Main Parent parentProductPartition and Main Parent
> BiddableAdGroupCriterion
> ProductPartition parentProductPartition = new
> ProductPartition();
>
> parentProductPartition.setPartitionType(ProductPartitionType.SUBDIVISION);
> parentProductPartition.setId(-1L);
>
> BiddableAdGroupCriterion parentBiddableAdGroupCriterion = new
> BiddableAdGroupCriterion();
>
> parentBiddableAdGroupCriterion.setCriterion(parentProductPartition);
>
> parentBiddableAdGroupCriterion.setAdGroupId(Long.parseLong(adGroupID));
>
> parentBiddableAdGroupCriterion.setUserStatus(UserStatus.PAUSED);
>
> parentBiddableAdGroupCriterion.setCriterionUse(CriterionUse.BIDDABLE);
>
> // Create child BiddableAdGroupCriterion and Child
> ProductPartition on CUSTOM_ATTRIBUTE_0
> ProductPartition childProductPartition = new
> ProductPartition();
>
> childProductPartition.setPartitionType(ProductPartitionType.UNIT);
>
> childProductPartition.setParentCriterionId(parentProductPartition.getId());
>
> ProductCustomAttribute productDimension1 = new
> ProductCustomAttribute();
>
> productDimension1.setProductDimensionType("ProductCustomAttribute");
>
> productDimension1.setType(ProductDimensionType.CUSTOM_ATTRIBUTE_0);
> productDimension1.setValue("auto-high10");
> childProductPartition.setCaseValue(productDimension1);
>
> BiddableAdGroupCriterion childBiddableAdGroupCriterion = new
> BiddableAdGroupCriterion();
>
> childBiddableAdGroupCriterion.setCriterion(childProductPartition);
>
> childBiddableAdGroupCriterion.setAdGroupId(Long.parseLong(adGroupID));
>
> childBiddableAdGroupCriterion.setUserStatus(UserStatus.ENABLED);
>
> childBiddableAdGroupCriterion.setCriterionUse(CriterionUse.BIDDABLE);
>
> // Create child NegativeAdGroupCriterion and Child
> ProductPartition on CUSTOM_ATTRIBUTE_0
> ProductPartition childNegativeProductPartition = new
> ProductPartition();
>
> childNegativeProductPartition.setPartitionType(ProductPartitionType.UNIT);
>
> childNegativeProductPartition.setParentCriterionId(parentProductPartition.getId());
>
> ProductCustomAttribute productDimension2 = new
> ProductCustomAttribute();
>
> productDimension2.setProductDimensionType("ProductCustomAttribute");
>
> productDimension2.setType(ProductDimensionType.CUSTOM_ATTRIBUTE_0);
> childNegativeProductPartition.setCaseValue(productDimension2);
>
> NegativeAdGroupCriterion childNegativeAdGroupCriterion = new
> NegativeAdGroupCriterion();
>
> childNegativeAdGroupCriterion.setCriterion(childNegativeProductPartition);
>
> childNegativeAdGroupCriterion.setAdGroupId(Long.parseLong(adGroupID));
>
> childNegativeAdGroupCriterion.setCriterionUse(CriterionUse.NEGATIVE);
>
> // Set Operation
> AdGroupCriterionOperation parentAdGroupCriterionOperation =
> new AdGroupCriterionOperation();
>
> parentAdGroupCriterionOperation.setOperand(parentBiddableAdGroupCriterion);
> parentAdGroupCriterionOperation.setOperator(Operator.ADD);
>
> AdGroupCriterionOperation child1AdGroupCriterionOperation =
> new AdGroupCriterionOperation();
>
> child1AdGroupCriterionOperation.setOperand(childNegativeAdGroupCriterion);
> child1AdGroupCriterionOperation.setOperator(Operator.ADD);
>
> AdGroupCriterionOperation child2AdGroupCriterionOperation =
> new AdGroupCriterionOperation();
>
> child2AdGroupCriterionOperation.setOperand(childBiddableAdGroupCriterion);
> child2AdGroupCriterionOperation.setOperator(Operator.ADD);
>
> AdGroupCriterionServiceInterface adGroupCriterionService =
> adWordsServices.get(session,
> AdGroupCriterionServiceInterface.class);
>
> AdGroupCriterionReturnValue adGroupCriterionReturnValue =
> adGroupCriterionService.mutate(
> new
> AdGroupCriterionOperation[]{parentAdGroupCriterionOperation,
> child1AdGroupCriterionOperation, child2AdGroupCriterionOperation});
>
> Thanks,
> Josh, Google Ads API Team
>
> ref:_00D1U1174p._5001UaSxD8:ref
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/bec850e1-4b11-4036-bb8a-87d91f3b3d20%40googlegroups.com.