This is the working php code for creating new product partition group. $root = new ProductPartition(); $root->setPartitionType(ProductPartitionType::SUBDIVISION); $root->setId(18283950120); // this is id of parent product group. you can get this id with PRODUCT_PARTITION_REPORT, from fields "id" (criterion id) and parent_id (parent criterion id) // $offerId = new ProductOfferId(); // это productDimension $offerId->setValue($product_id); // this is inner product id from your merchant feed for which you want to create new partition group $newUnit = ProductPartitions::createUnit($root, $offerId); $criterion = ProductPartitions::asBiddableAdGroupCriterion( 22622716325, // your merchant adgroup_id $newUnit, 4*1000000 // bid for new partition group ); $operation = ProductPartitions::createAddOperation($criterion); $operations[] = $operation; // $adWordsServices = new AdWordsServices(); $session = $this->getSession(); $adGroupCriterionService = $adWordsServices->get($session, AdGroupCriterionService::class); $adGroupCriterionService->mutate($operations);
вторник, 2 апреля 2019 г., 0:03:12 UTC+3 пользователь Akbar Ali написал: > > I am working with Google AdWords API to create ad groups and product > groups (Product partitions) using the PHP client library provided by Google > team. I have successfully created the ad groups using that library. But I > am stuck at the point to create product groups for that ad group. > > I have tried to create products partitions for that shopping campaign > using the script "AddProductPartitionTree.php" provided in the client > library. But every time it throws an error > > [AdGroupCriterionError.PRODUCT_PARTITION_ALREADY_EXISTS @ operations[8]. > > Will you please update about it. > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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/6ffbb1e8-6756-4df9-90a4-293e0db9ef86%40googlegroups.com.
