Hi there, I think the issue might be that the tree you're creating is invalid, in that it only has a root node. Take a look at our sample code; it creates a full tree, using some utilities that should make your life a lot easier:
https://github.com/googleads/googleads-php-lib/blob/master/examples/AdWords/v201406/ShoppingCampaigns/AddProductPartitionTree.php Hope this helps! Cheers, Sérgio --- Sérgio Gomes Developer Relations Google UK Limited Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ Registered in England Number: 3977902 On Wednesday, 20 August 2014 13:46:59 UTC+1, [email protected] wrote: > > Hello, > > using the PHP Library v201402 and the Google Adwords API and the Content > API for Shopping I want to create shopping campaigns with products from an > Google Merchant Center Account. > > Via the API I can generate campaigns and adgroups, but I can't create > product partions (like productgroups) into the adgroup. Here is my code for > the product partition: > > $productPartition = new \ProductPartition('UNIT'); > > $adGroupCriterion = new \BiddableAdGroupCriterion(); > $adGroupCriterion->criterion = $productPartition; > $adGroupCriterion->adGroupId = <adgroupId from the last generated adGroup > >; > > $operation = new \AdGroupCriterionOperation(); > $operation->operand = $adGroupCriterion; > $operation->operator = 'ADD'; > > $operations = array($operation); > $adGroupCriterionService->mutate($operations); > > Is this the right way to generate a product partition? I read the docs a > lot of times but i don't know if this is right. > > Can anyone help me? > > > Greetings from Germany > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords 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 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/6a01d708-75a4-4927-95aa-d5ff52db83c5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
