$operations = []; $root = ProductPartitions::createSubdivision(); ///This is what I think is causing the problem, $criterion = ProductPartitions::asBiddableAdGroupCriterion($adGroupId, $root); $operation = ProductPartitions::createAddOperation($criterion); $operations[] = $operation; $otherCondition = ProductPartitions::createSubdivision( $root, new ProductCanonicalCondition() ); $criterion = ProductPartitions::asBiddableAdGroupCriterion( $adGroupId, $otherCondition ); $operation = ProductPartitions::createAddOperation($criterion); $operations[] = $operation; $otherBrand = ProductPartitions::createSubdivision( $otherCondition, new ProductOfferId() ); $criterion = ProductPartitions::asBiddableAdGroupCriterion( $adGroupId, $otherBrand ); $operation = ProductPartitions::createAddOperation($criterion); $operations[] = $operation; $productBiddingCategory = new ProductBiddingCategory(); $productBiddingCategory->setType(ProductDimensionType::BIDDING_CATEGORY_L1); $productBiddingCategoryUnit = ProductPartitions::createUnit($otherBrand, $productBiddingCategory); $criterion = ProductPartitions::asBiddableAdGroupCriterion( $adGroupId, $productBiddingCategoryUnit, 10000 ); $operation = ProductPartitions::createAddOperation($criterion); $operations[] = $operation;
$cheapBrand = new ProductOfferId(); $cheapBrand->setValue($sku); $cheapBrandUnit = ProductPartitions::createUnit($root, $cheapBrand); ///Where this line says $root I think it's trying to re-create $root rather than get the previously created. $criterion = ProductPartitions::asBiddableAdGroupCriterion( $adGroupId, $cheapBrandUnit, $bid_trans ); $operation = ProductPartitions::createAddOperation($criterion); $operations[] = $operation;
AdGroupCriterionError.PRODUCT_PARTITION_DOES_NOT_EXIST @ operations[1].operand.criterion.parentCriterionId;
Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
public static function createUnit( ProductPartition $parent = null, ProductDimension $value = null ) { $unit = new ProductPartition(); $unit->setPartitionType(ProductPartitionType::UNIT);
// The root node has neither a parent nor a value if ($parent !== null) { $unit->setParentCriterionId($parent->getId()); $unit->setCaseValue($value); }
return $unit; } public static function createUnit2($parent,$value) { $unit = new ProductPartition(); $unit->setPartitionType(ProductPartitionType::UNIT);
// The root node has neither a parent nor a value $unit->setParentCriterionId($parent); $unit->setCaseValue($value);
return $unit; }
Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/d5bb97f5-47f3-4803-a52d-f6f897f033cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.