Ray,

Thank you for the help.  I am now sending the REMOVE and ADD based on the 
guides your provided.  Now I am now getting a different error:

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=[]}'

I am under the impression that sending a ProductOfferId with an empty 
value, creates the OTHERS_CASE the API is looking for.  It appears my 
impression is false.  I have been digging though the docs trying to find 
out how to set this up, but the only examples I can find, are using 
ProductBrand, ProductCanoicalCondidiont, or ProductBiddingCategory.  Any 
further help with how to set this up with the ProductOfferId would be much 
appreciated 

Here is the mutate XML that I am sending:

    <ns1:mutate>
      <ns1:operations>
        <ns1:operator>REMOVE</ns1:operator>
        <ns1:operand xsi:type="ns1:BiddableAdGroupCriterion">
          <ns1:adGroupId>9319923940</ns1:adGroupId>
          <ns1:criterionUse>BIDDABLE</ns1:criterionUse>
          <ns1:criterion xsi:type="ns1:ProductPartition">
            <ns1:id>18283950120</ns1:id>
            <ns1:type>PRODUCT_PARTITION</ns1:type>
            <ns1:Criterion.Type>ProductPartition</ns1:Criterion.Type>
            <ns1:partitionType>SUBDIVISION</ns1:partitionType>
          </ns1:criterion>
          
<ns1:AdGroupCriterion.Type>BiddableAdGroupCriterion</ns1:AdGroupCriterion.Type>
        </ns1:operand>
      </ns1:operations>
      <ns1:operations>
        <ns1:operator>ADD</ns1:operator>
        <ns1:operand xsi:type="ns1:BiddableAdGroupCriterion">
          <ns1:adGroupId>9319923940</ns1:adGroupId>
          <ns1:criterion xsi:type="ns1:ProductPartition">
            <ns1:id>-1</ns1:id>
            <ns1:type>PRODUCT_PARTITION</ns1:type>
            <ns1:Criterion.Type>ProductPartition</ns1:Criterion.Type>
            <ns1:partitionType>SUBDIVISION</ns1:partitionType>
          </ns1:criterion>
        </ns1:operand>
      </ns1:operations>
      <ns1:operations>
        <ns1:operator>ADD</ns1:operator>
        <ns1:operand xsi:type="ns1:BiddableAdGroupCriterion">
          <ns1:adGroupId>9319923940</ns1:adGroupId>
          <ns1:criterion xsi:type="ns1:ProductPartition">
            <ns1:type>PRODUCT_PARTITION</ns1:type>
            <ns1:Criterion.Type>ProductPartition</ns1:Criterion.Type>
            <ns1:partitionType>UNIT</ns1:partitionType>
            <ns1:parentCriterionId>-1</ns1:parentCriterionId>
            <ns1:caseValue xsi:type="ns1:ProductOfferId">
              <ns1:value>m1400</ns1:value>
            </ns1:caseValue>
          </ns1:criterion>
          <ns1:biddingStrategyConfiguration>
            <ns1:bids xsi:type="ns1:CpcBid">
              <ns1:bid>
                <ns1:microAmount>20000</ns1:microAmount>
              </ns1:bid>
            </ns1:bids>
          </ns1:biddingStrategyConfiguration>
        </ns1:operand>
      </ns1:operations>
      <ns1:operations>
        <ns1:operator>ADD</ns1:operator>
        <ns1:operand xsi:type="ns1:BiddableAdGroupCriterion">
          <ns1:adGroupId>9319923940</ns1:adGroupId>
          <ns1:criterion xsi:type="ns1:ProductPartition">
            <ns1:type>PRODUCT_PARTITION</ns1:type>
            <ns1:Criterion.Type>ProductPartition</ns1:Criterion.Type>
            <ns1:partitionType>UNIT</ns1:partitionType>
            <ns1:parentCriterionId>-1</ns1:parentCriterionId>
            <ns1:caseValue xsi:type="ns1:ProductOfferId">
              <ns1:value/>
            </ns1:caseValue>
          </ns1:criterion>
          <ns1:biddingStrategyConfiguration>
            <ns1:bids xsi:type="ns1:CpcBid">
              <ns1:bid>
                <ns1:microAmount>20000</ns1:microAmount>
              </ns1:bid>
            </ns1:bids>
          </ns1:biddingStrategyConfiguration>
        </ns1:operand>
      </ns1:operations>
    </ns1:mutate>

On Friday, June 20, 2014 3:46:33 PM UTC-4, Ray Tsang (AdWords API Team) 
wrote:
>
> Chuck,
>
> We have a related forum thread 
> <https://groups.google.com/forum/#!msg/adwords-api/P6DYn6N3XTU/URoOTS5xGIUJ> 
> that 
> had similar issues and examples.  Also for your reference, we have a set 
> of slides <http://www.slideshare.net/marcwan/02-shopping> that you may 
> find helpful as well.
>
> The partition type 
> <https://developers.google.com/adwords/api/docs/reference/v201402/AdGroupCriterionService.ProductPartition#partitionType>
>  
> can only be set when using the ADD operation, hence you will need to remove 
> the root node and re-adding it with the SUBDIVISON type.
>
> Lastly, when adding children nodes, you can use the temporary ID *if* you 
> are also re-adding the parent node with that ID in the same mutate request. 
>  Otherwise, you would need to set it to a valid parent ID that may already 
> exist.
>
> Thanks!
>
> Ray
>
>
> On Friday, June 20, 2014 11:33:47 AM UTC-4, Chuck Reeves wrote:
>>
>> I am following the example PHP script for adding a group partition found 
>> here: 
>> https://github.com/googleads/googleads-php-lib/blob/master/examples/AdWords/v201402/ShoppingCampaigns/AddProductPartitionTree.php
>>
>> The adGroup is created in AdWords and only contains the default Partition 
>> which is of a type UNIT.  When I try the following code. I get this error: 
>>
>> attempting change failed: 
>> [AdGroupCriterionError.PRODUCT_PARTITION_ALREADY_EXISTS @ 
>> operations[0].operand.criterion, 
>> AdGroupCriterionError.PRODUCT_PARTITION_DOES_NOT_EXIST @ 
>> operations[1].operand.criterion.parentCriterionId; 
>> trigger:'TempCriterionId{id=1}']
>>
>> PHP Code: 
>>
>> $operations = [];
>>
>> // Create Root
>> $root = new ProductPartition('SUBDIVISION');
>> $root->id = -1;
>>
>> $rootCriterion = new BiddableAdGroupCriterion();
>> $rootCriterion ->adGroupId = $adGroupId;
>> $rootCriterion ->criterion = $root;
>>
>> $rootOperation = new AdGroupCriterionOperation();
>> $rootOperation->operand = $rootCriterion ;
>> $rootOperation->operator = 'ADD';
>> $operations[] = $rootOperation;
>>
>> // Create bid for product
>> $value = new ProductOfferId();
>> $value->value = 'MANCHUCK';
>>
>> $unit = new ProductPartition('UNIT');
>> $unit->parentCriterionId = $root->id;
>> $unit->caseValue = $value;
>>
>> $biddingStrategyConfiguration = new \BiddingStrategyConfiguration();
>> $biddingStrategyConfiguration->bids = [];
>> $cpcBid = new \CpcBid();
>> $cpcBid->bid = new \Money(20000);
>> $biddingStrategyConfiguration->bids[] = $cpcBid;
>>
>> $criterion = new \BiddableAdGroupCriterion();
>> $criterion->adGroupId = $adGroupId;
>> $criterion->criterion = $unit;
>> $criterion->biddingStrategyConfiguration = $biddingStrategyConfiguration;
>>
>> $operation = new \AdGroupCriterionOperation();
>> $operation->operand = $criterion;
>> $operation->operator = 'ADD';
>> $operations[] = $operation;
>>
>> // Send the ops to be mutated
>> try {
>>     $service->mutate($operations);
>> } catch (\Exception $googleException) {
>>     echo sprintf('attempting change failed: %s', 
>> $googleException->getMessage());
>>     die(2);
>> }
>>
>>
>> echo "Done";
>>
>>
>> If I use the Admin panel to create the unit partition as I want, I see 
>> that 3 partitions are created
>>
>> The default partition is updated to be of type SUBDIVISION
>> The 2nd partition is the one that contains the item I wanted 
>> The 3rd partition is the fallback for everything else.  
>>
>> I tried to SET the root partition as a SUBDIVISION then add the other two 
>> which failed with the following error: 
>> attempting change failed: 
>> [AdGroupCriterionError.PRODUCT_PARTITION_UNIT_CANNOT_HAVE_CHILDREN @ 
>> operations; trigger:'ProductPartition{id=CriterionId{id=*********}, 
>> bidSimulatorStatus=null, partitionType=UNIT, parentCriterionId=null, 
>> caseValue=null, decisionPath=[]}']
>>
>> I then tried to just add the one UNIT partition alone and got an error 
>> stating I'm missing the parentCriterionId:
>> attempting change failed: [RequiredError.REQUIRED @ 
>> operations[0].operand.criterion.parentCriterionId]
>>
>> So I then tried doing the -1 for that Id and got 
>>
>> attempting change failed: 
>> [AdGroupCriterionError.PRODUCT_PARTITION_DOES_NOT_EXIST @ 
>> operations[0].operand.criterion.parentCriterionId; 
>> trigger:'TempCriterionId{id=1}']
>>
>> I have not tried to remove the default partition and starting with a 
>> clean slate because I do not see that happening through the UI.  I have 
>> been all over the docs and the code I pasted above is all I found about the 
>> subject.  Is there something I am missing in the docs?  Is there a step 
>> that might not be documented?  Could there be something with the 
>> account/campaign/adGroup that I need to change that I missed?  Any insight 
>> would be helpful.
>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to