Hi Peter
Im building upon the addShoppingCampaign.java code

changed the code a little too

    if (createDefaultPartition) {
      // Create an ad group criterion for 'All products' using the 
ProductPartitionTree utility.
      ProductPartitionTree productPartitionTree =
          ProductPartitionTree.createAdGroupTree(adWordsServices, session, 
adGroup.getId());
      productPartitionTree
      
.getRoot().asSubdivision().addChild(ProductDimensions.createOfferId("9420020220386")).asBiddableUnit().setBid(900000L);
           
      List<AdGroupCriterionOperation> mutateOperations = 
productPartitionTree.getMutateOperations();

      // Make the mutate request.
      AdGroupCriterionServiceInterface adGroupCriterionService =
          adWordsServices.get(session, 
AdGroupCriterionServiceInterface.class);
      AdGroupCriterionReturnValue adGroupCriterionResult =
          adGroupCriterionService.mutate(
              mutateOperations.toArray(new AdGroupCriterionOperation[0]));

      // Display result.
      for (AdGroupCriterion adGroupCriterion : 
adGroupCriterionResult.getValue()) {
        System.out.printf(
            "Ad group criterion with ID %d in ad group with ID %d was 
added.%n",
            adGroupCriterion.getCriterion().getId(), 
adGroupCriterion.getAdGroupId());
      }


And getting
  Error 1: AdGroupCriterionError{apiErrorType=AdGroupCriterionError, 
errorString=AdGroupCriterionError.PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE,
 
fieldPath=operations, 
fieldPathElements=[FieldPathElement{field=operations}], 
reason=PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE, 
trigger=ProductPartition{id=TempCriterionId{id=1}, bidSimulatorStatus=null, 
partitionType=SUBDIVISION, parentCriterionId=null, productGroup=null, 
productGroupObsoleteStatus=null, caseValue=null, decisionPath=[], 
salesCountry=null, merchantId=null, hasPromotedSuggestion=null}}

what is meant by PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE and how 
do i fix it

onsdag den 29. august 2018 kl. 10.34.25 UTC+2 skrev Peter Oliquino (AdWords 
API Team):
>
> Hi Thomas,
>
> You can review our shopping campaigns 
> <https://developers.google.com/adwords/api/docs/guides/shopping> guide on 
> how you can configure your accounts and create shopping campaigns with 
> their corresponding bids and product partitions and set its product 
> dimensions 
> <https://developers.google.com/adwords/api/docs/guides/shopping#product_dimensions>
>  (ProductOfferId 
> <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService.ProductOfferId>
> ).
>
> As for excluding "everything else", I'm afraid that there is no direct way 
> to achieve this. Using the AdGroupCriterionService.mutate() 
> <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService#mutate>
>  method, 
> you will have to REMOVE it and ADD it again, however this time, you will 
> need to ADD it as a NegativeAdGroupCriterion 
> <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService.NegativeAdGroupCriterion>
> .
>
> Best regards,
> Peter
> AdWords API Team
>
> On Wednesday, August 29, 2018 at 11:44:04 AM UTC+8, Thomas Bisballe wrote:
>>
>> How do i add a single product id from merchant center into a new Adgroup 
>> in a new shopping campaign in JAVA
>> with a cpc bid of 2 euros 
>> and make it exclude everything else in "all products"
>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@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/a79fe95d-557a-4020-beb2-db45b15e24eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... Thomas Bisballe
    • ... 'Peter Oliquino (AdWords API Team)' via AdWords API and Google Ads API Forum
      • ... Thomas Bisballe
        • ... 'Peter Oliquino (AdWords API Team)' via AdWords API and Google Ads API Forum

Reply via email to