Limits issue: ProductPartitionTree .createAdGroupTree generates API request

127 views
Skip to first unread message

Константин Латыпов

unread,
Jun 22, 2018, 2:37:08 AM6/22/18
to AdWords API and Google Ads API Forum
Hello

As I see this code generates request:
        ProductPartitionTree partitionTree = ProductPartitionTree
                .createAdGroupTree(adWordsServices, authService.getSession(), partition.getAdGroupId());

logs:
[INFO ] c.g.a.a.a.l.c.AdWordsServiceClient.requestInfoLogger - Request made: Service: AdGroupCriterionService Method: get clientCustomerId: XXX-XXX-XXXX URL: https://adwords.google.com/api/adwords/cm/v201806/AdGroupCriterionService Request ID: 00056f250bff1d980a37ad11c90e5b30 ResponseTime(ms)
: 243 OperationsCount: 1 IsFault: false FaultMessage: null (RemoteCallLoggerDelegate.java:146)#logRequestSummary

I t need to generate batch job with about 10000 partitions creatins. So, I have this issue:
It takes too long time. 5000 partitions trees creates about 40min. And it finished with limits error. 
At prod account I have standart access, but too long time for creation is critical.

Maybe there is some other way?
I need to create new Ad Groups and Partitions with Product ID Dimension.

Thanks



Dannison Yao (AdWords API Team)

unread,
Jun 22, 2018, 4:50:27 AM6/22/18
to AdWords API and Google Ads API Forum
Hi,

To further investigate on this, could you provide any error messages for the "limits error" that you mentioned along with the batch job Id and the clientCustomerId you used? You may send those to me via the Reply privately to author.

Regards,
Dannison
AdWords API Team

Константин Латыпов

unread,
Jun 22, 2018, 7:54:28 AM6/22/18
to AdWords API and Google Ads API Forum
Hi,

 errors=[RateExceededError{apiErrorType=RateExceededError, errorString=RateExceededError.RATE_EXCEEDED, fieldPath=, rateName=OperationsPerDay, rateScope=DEVELOPER, reason=RATE_EXCEEDED, retryAfterSeconds=86400, trigger=Basic Access Operations Quota}]}

I know about account limits etc.  
My issue is:
When I try to create bactch job operations ProductPartitionTree.createAdGroupTree send request to API. It generate a lot of requests and take a lot of time.

I thinks that there is some other way to prepare operations for creating new Partition tree. Without sending request for each operation. 

Thanks.


пятница, 22 июня 2018 г., 11:50:27 UTC+3 пользователь Dannison Yao (AdWords API Team) написал:

Dannison Yao (AdWords API Team)

unread,
Jun 25, 2018, 3:41:23 AM6/25/18
to AdWords API and Google Ads API Forum
Hi,

Regarding your issue with using the batch job service to create your ProductPartition trees, could you confirm if your batch operations are taking too long and is not completing successfully? Currently the only way to create partitions without having to pass multiple requests is through the usage of the BatchJobService.

Now, if you are encountering any issues or your batch operations are not getting pushed through, could you provide your clientCustomerId and the batch job IDs so our team could further investigate on this? You may reply to me via the Reply privately to author.

Константин Латыпов

unread,
Jun 25, 2018, 7:02:08 AM6/25/18
to AdWords API and Google Ads API Forum
Hi,

Yes, I'm using batchJobService. But when I prepare operations by provided code ( at previous posts) it generates requests to API. And it seems that there is some other way to create Partitions for new AdGroup. Something like thais at PHP:
https://developers.google.com/adwords/api/docs/samples/php/shopping-campaigns
$operation = ProductPartitions::createAddOperation($criterion);

So, my questions is:
How can I create new Partitions or PartitionTree via Java SDK ( without sending requests to API ) and put it to Operations (which will be placed to batchJob).

For example:
ProductPartition rootPartition = new ProductPartition();
rootPartition.setPartitionType(ProductPartitionType.SUBDIVISION);
// There Should be some code to create operations !!!


Thanks

понедельник, 25 июня 2018 г., 10:41:23 UTC+3 пользователь Dannison Yao (AdWords API Team) написал:

Dannison Yao (AdWords API Team)

unread,
Jun 26, 2018, 3:39:21 AM6/26/18
to AdWords API and Google Ads API Forum
Hi,

Unfortunately, we do not have an exact sample code on how to use Batch Job Processing for Product Partition, however, you can pattern your code on this example to create your product partition tree. You can then specify a ProductPartition root and your partition nodes as stated here and pass them to the AdGroupCriterionOperation before ultimately passing it to the BatchJobService itself.

You may note that you can pass multiple operations and the BatchJobService will handle all these operations in a single request.

Константин Латыпов

unread,
Jun 26, 2018, 5:31:02 AM6/26/18
to AdWords API and Google Ads API Forum
Hi,

Tell me please how can I pass Partitions to AdGroupCriterionOperations. It have no any suitable methods:


                ProductPartition rootPartition = new ProductPartition();
                rootPartition.setPartitionType(ProductPartitionType.SUBDIVISION);
                // Create operation.
                AdGroupCriterionOperation criterionOperation = new AdGroupCriterionOperation();
                AdGroupCriterion adGroupCriterion = new AdGroupCriterion();
                adGroupCriterion.setAdGroupId(adGroup.getId());

// There should be adding partitions, It hink so. But how??

                criterionOperation.setOperator(Operator.ADD);
                criterionOperation.setOperand(adGroupCriterion);

вторник, 26 июня 2018 г., 10:39:21 UTC+3 пользователь Dannison Yao (AdWords API Team) написал:

Dannison Yao (AdWords API Team)

unread,
Jun 27, 2018, 2:37:42 AM6/27/18
to AdWords API and Google Ads API Forum
Hi,

After creating your ProductPartition object, you have to set this criterion to a BiddableAdGroupCriterion object. After this, you need to add the BiddableAdGroupCriterion object to an AdGroupCriterionOperation object. Refer to the sample Java code below for reference.

         // Create AdGroupCriterionOperation.
        ProductPartition rootPartition = new ProductPartition();
        rootPartition.setPartitionType(ProductPartitionType.SUBDIVISION);

    // Create BiddableAdGroupCriterion.
        BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion();
        biddableAdGroupCriterion.setAdGroupId(newAdGroupId);
        biddableAdGroupCriterion.setCriterion(productPartition);

    // Create AdGroupCriterionOperation.
        AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
        operation.setOperand(biddableAdGroupCriterion);
        operation.setOperator(Operator.ADD);

    // Add to list.
        adGroupCriteriaOperations.add(operation);

You can follow the guide provided (buildAdGroupCriterionOperations() method) on how to add adgroup criterion to a BatchJobService.

Константин Латыпов

unread,
Jun 27, 2018, 6:43:10 AM6/27/18
to AdWords API and Google Ads API Forum
Thank you!

But I have next issue.
I have AdGroupOperations with negative temporari IDs. I create SUBDIVISION, ProductID dimension and Others Partitions. I send AdGroup and Partition opeartions at one job. When I try to create Partitions I receive following ERRORS:
2018-06-27 13:39:59.625  INFO 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     :   Operation [0] - SUCCESS
2018-06-27 13:39:59.625  INFO 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     :   Operation [1] - FAILURE
2018-06-27 13:39:59.625 ERROR 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     :   Processing error : errorType=AdGroupCriterionError, 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}, errorString=AdGroupCriterionError.PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE, fieldPath=operations[1].operand
2018-06-27 13:39:59.625  INFO 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     : Sending group results GroupResult(pdid=ProductPartition{id=TempCriterionId{id=1}, bidSimulatorStatus=null, partitionType=SUBDIVISION, parentCriterionId=null, productGroup=null, productGroupObsoleteStatus=null, caseValue=null, decisionPath=[], salesCountry=null, merchantId=null, hasPromotedSuggestion=null}, status=FAIL)
2018-06-27 13:39:59.630  INFO 23531 --- [pool-2-thread-1] o.s.i.codec.kryo.CompositeKryoRegistrar  : registering [40, java.io.File] with serializer org.springframework.integration.codec.kryo.FileSerializer
2018-06-27 13:39:59.651  INFO 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     :   Operation [2] - FAILURE
2018-06-27 13:39:59.651 ERROR 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     :   Processing error : errorType=RequiredError, trigger=, errorString=RequiredError.REQUIRED, fieldPath=operations[2].operand.biddingStrategyConfiguration
2018-06-27 13:39:59.651 ERROR 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     :   Processing error : errorType=AdGroupCriterionError, 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}, errorString=AdGroupCriterionError.PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE, fieldPath=operations[2].operand
2018-06-27 13:39:59.651  INFO 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     : Sending group results GroupResult(pdid=ProductPartition{id=TempCriterionId{id=1}, bidSimulatorStatus=null, partitionType=SUBDIVISION, parentCriterionId=null, productGroup=null, productGroupObsoleteStatus=null, caseValue=null, decisionPath=[], salesCountry=null, merchantId=null, hasPromotedSuggestion=null}, status=FAIL)
2018-06-27 13:39:59.651  INFO 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     :   Operation [3] - FAILURE
2018-06-27 13:39:59.651 ERROR 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     :   Processing error : errorType=RequiredError, trigger=, errorString=RequiredError.REQUIRED, fieldPath=operations[3].operand.biddingStrategyConfiguration
2018-06-27 13:39:59.651 ERROR 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     :   Processing error : errorType=AdGroupCriterionError, 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}, errorString=AdGroupCriterionError.PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE, fieldPath=operations[3].operand
2018-06-27 13:39:59.651  INFO 23531 --- [pool-2-thread-1] d.p.m.a.service.service.GroupService     : Sending group results GroupResult(pdid=ProductPartition{id=TempCriterionId{id=1}, bidSimulatorStatus=null, partitionType=SUBDIVISION, parentCriterionId=null, productGroup=null, productGroupObsoleteStatus=null, caseValue=null, decisionPath=[], salesCountry=null, merchantId=null, hasPromotedSuggestion=null}, status=FAIL)


It seems like this 3 Partitions not linked beetwen each others.

My code:
    /**
     * Create Product Partition Operations for provided AdGroupOperations
     *
     * @param adGroupOperations
     * @return
     */
    private List<AdGroupCriterionOperation> buildPartitions(List<AdGroupOperation> adGroupOperations) {
        List<AdGroupCriterionOperation> adGroupCriterionOperations = new LinkedList<>();
        adGroupOperations.forEach(adGroupOperation -> {
            AdGroup adGroup = adGroupOperation.getOperand();

            if (AdGroupStatus.REMOVED.equals(adGroup.getStatus())) {
                return;
            }

            // --- Create Root Subdivision --------------------------
            // Create AdGroupCriterionOperation.
            ProductPartition rootPartition = new ProductPartition();
            rootPartition.setPartitionType(ProductPartitionType.SUBDIVISION);
            rootPartition.setId(adGroup.getId());

            // Create BiddableAdGroupCriterion.
            BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion();
            biddableAdGroupCriterion.setAdGroupId(adGroup.getId());
            biddableAdGroupCriterion.setCriterion(rootPartition);

            // Create AdGroupCriterionOperation.
            AdGroupCriterionOperation rootOperation = new AdGroupCriterionOperation();
            rootOperation.setOperand(biddableAdGroupCriterion);
            rootOperation.setOperator(Operator.ADD);

            // --- Create Product Dimensions ----------------------
            ProductOfferId dimensionType = ProductDimensions.createOfferId(adGroup.getName());
            ProductOfferId emptyDimensionType = new ProductOfferId();

            // --- Create Product ID UNIT --------------------------
            ProductPartition productNode = new ProductPartition();
            productNode.setPartitionType(ProductPartitionType.UNIT);
            productNode.setCaseValue(dimensionType);
            productNode.setParentCriterionId(rootPartition.getId());

            // Create BiddableAdGroupCriterion.
            BiddableAdGroupCriterion productAdGroupCriterion = new BiddableAdGroupCriterion();
            productAdGroupCriterion.setAdGroupId(adGroup.getId());
            productAdGroupCriterion.setCriterion(productNode);

            // Create AdGroupCriterionOperation.
            AdGroupCriterionOperation productOperation = new AdGroupCriterionOperation();
            productOperation.setOperand(productAdGroupCriterion);
            productOperation.setOperator(Operator.ADD);


            // --- Create Others UNIT --------------------------
            ProductPartition emptyNode = new ProductPartition();
            emptyNode.setPartitionType(ProductPartitionType.UNIT);
            emptyNode.setCaseValue(emptyDimensionType);
            emptyNode.setParentCriterionId(rootPartition.getId());

            // Create BiddableAdGroupCriterion.
            BiddableAdGroupCriterion emptyAdGroupCriterion = new BiddableAdGroupCriterion();
            emptyAdGroupCriterion.setAdGroupId(adGroup.getId());
            emptyAdGroupCriterion.setCriterion(emptyNode);

            // Create AdGroupCriterionOperation.
            AdGroupCriterionOperation emptyOperation = new AdGroupCriterionOperation();
            emptyOperation.setOperand(emptyAdGroupCriterion);
            emptyOperation.setOperator(Operator.ADD);

            // Add to list.
            adGroupCriterionOperations.add(rootOperation);
            adGroupCriterionOperations.add(productOperation);
            adGroupCriterionOperations.add(emptyOperation);
        });
        return adGroupCriterionOperations;
    }


Best regards

среда, 27 июня 2018 г., 9:37:42 UTC+3 пользователь Dannison Yao (AdWords API Team) написал:

Dannison Yao (AdWords API Team)

unread,
Jun 28, 2018, 4:43:51 AM6/28/18
to AdWords API and Google Ads API Forum
Hi,

According to your logs, you are encountering the error RequiredError.REQUIRED, which means that you have a missing entity that the service you are using needs before it executes. Another error you are encountering is the PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE error which is encountered when your subdivision does not have an "others" case. Upon investigation of your code, after you have created your root subdivision, you immediately added it on your BiddableAdGroupCriterion. This is the reason you are encountering the error, you should associate your ProductPartition Root to your "Other" case first before adding it in your BiddableAdGroupCriterion.

Let me know how this goes.

Константин Латыпов

unread,
Jun 28, 2018, 10:31:27 AM6/28/18
to AdWords API and Google Ads API Forum
Hi,

I think that I dont understand this: "you should associate your ProductPartition Root to your "Other" case first before adding it in your BiddableAdGroupCriterion".
I thought that this is association code: 
productNode.setParentCriterionId(rootPartition.getId());

But it still not working:

        operations.addAll(adGroupOperations);
        operations.addAll(buildPartitions(adGroupOperations));

        // Use a BatchJobHelper to upload all operations.
        BatchJobHelper batchJobHelper = adWordsServices
                .getUtility(authService.getSession(), BatchJobHelper.class);
        batchJobHelper.uploadBatchJobOperations(operations, batchJob.getUploadUrl().getUrl());

     ---------------------------------


    /**
     * Create Product Partition Operations for provided AdGroupOperations
     *
     * @param adGroupOperations
     * @return
     */
    private List<AdGroupCriterionOperation> buildPartitions(List<AdGroupOperation> adGroupOperations) {
        List<AdGroupCriterionOperation> adGroupCriterionOperations = new LinkedList<>();
        adGroupOperations.forEach(adGroupOperation -> {
            AdGroup adGroup = adGroupOperation.getOperand();

            if (AdGroupStatus.REMOVED.equals(adGroup.getStatus())) {
                return;
            }

            // --- Create Product Dimensions ----------------------
            ProductOfferId dimensionType = ProductDimensions.createOfferId(adGroup.getName());
            ProductOfferId emptyDimensionType = new ProductOfferId();

            // --- Create Root Subdivision --------------------------
            // Create AdGroupCriterionOperation.
            ProductPartition rootPartition = new ProductPartition();
            rootPartition.setPartitionType(ProductPartitionType.SUBDIVISION);
            rootPartition.setId(adGroup.getId());
            // --- Create Product ID UNIT --------------------------
            ProductPartition productNode = new ProductPartition();
            productNode.setPartitionType(ProductPartitionType.UNIT);
            productNode.setCaseValue(dimensionType);
            productNode.setParentCriterionId(rootPartition.getId());
            productNode.setId(adGroup.getId() * 100000 - 1);

            // --- Create Others UNIT --------------------------
            ProductPartition emptyNode = new ProductPartition();
            emptyNode.setPartitionType(ProductPartitionType.UNIT);
            emptyNode.setCaseValue(emptyDimensionType);
            emptyNode.setParentCriterionId(rootPartition.getId());
            emptyNode.setId(adGroup.getId() * 100000 - 2);

            // Create BiddableAdGroupCriterion.
            BiddableAdGroupCriterion productAdGroupCriterion = new BiddableAdGroupCriterion();
            productAdGroupCriterion.setAdGroupId(adGroup.getId());
            productAdGroupCriterion.setCriterion(productNode);

            // Create AdGroupCriterionOperation.
            AdGroupCriterionOperation productOperation = new AdGroupCriterionOperation();
            productOperation.setOperand(productAdGroupCriterion);
            productOperation.setOperator(Operator.ADD);

            // Create BiddableAdGroupCriterion.
            BiddableAdGroupCriterion emptyAdGroupCriterion = new BiddableAdGroupCriterion();
            emptyAdGroupCriterion.setAdGroupId(adGroup.getId());
            emptyAdGroupCriterion.setCriterion(emptyNode);

            // Create AdGroupCriterionOperation.
            AdGroupCriterionOperation emptyOperation = new AdGroupCriterionOperation();
            emptyOperation.setOperand(emptyAdGroupCriterion);
            emptyOperation.setOperator(Operator.ADD);

            // Create BiddableAdGroupCriterion.
            BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion();
            biddableAdGroupCriterion.setAdGroupId(adGroup.getId());
            biddableAdGroupCriterion.setCriterion(rootPartition);

            // Create AdGroupCriterionOperation.
            AdGroupCriterionOperation rootOperation = new AdGroupCriterionOperation();
            rootOperation.setOperand(biddableAdGroupCriterion);
            rootOperation.setOperator(Operator.ADD);

            // Add to list.
            adGroupCriterionOperations.add(productOperation);
            adGroupCriterionOperations.add(emptyOperation);
            adGroupCriterionOperations.add(rootOperation);
        });
        return adGroupCriterionOperations;
    }



Best regards


четверг, 28 июня 2018 г., 11:43:51 UTC+3 пользователь Dannison Yao (AdWords API Team) написал:

Dannison Yao (AdWords API Team)

unread,
Jun 29, 2018, 3:52:30 AM6/29/18
to AdWords API and Google Ads API Forum
Hi,

My apologies for the back and forth. Could you send me your complete SOAP request and response logs that was generated when you used this code you sent in your previous response along with your clientCustomerId so I could further investigate this? You may send this via Reply privately to author. Could you also set your SOAP XML logger to DEBUG mode?

Константин Латыпов

unread,
Jul 2, 2018, 10:39:16 AM7/2/18
to AdWords API and Google Ads API Forum
Hi, Dannison

I sent you info via "Reply privately to author" at friday. If you will need any additional info I will be glad to provide it.

Best regards

пятница, 29 июня 2018 г., 10:52:30 UTC+3 пользователь Dannison Yao (AdWords API Team) написал:

Anash P. Oommen (AdWords API Team)

unread,
Jul 2, 2018, 12:24:45 PM7/2/18
to AdWords API and Google Ads API Forum
Hi,

Could you try a few things?

1. You are missing a biddingStrategyConfiguration node in couple of operands, could you add them?
2. Could you make sure the root node appears before the child nodes in the operations list?

Let me know if that doesn't address the issues.

Cheers
Anash P. Oommen,
AdWords API Team.

Константин Латыпов

unread,
Jul 3, 2018, 11:06:09 AM7/3/18
to AdWords API and Google Ads API Forum
Thank you.

this code fixed issue:
  productAdGroupCriterion.setBiddingStrategyConfiguration(adGroup.getBiddingStrategyConfiguration());
  emptyAdGroupCriterion.setBiddingStrategyConfiguration(adGroup.getBiddingStrategyConfiguration());

But there is last issue (I hope)
How can I create exculuded partition?

Something like this code for PartitionNode:
  partitionNode
    .addChild(emptyDimensionType)
    .asExcludedUnit();


Best regards


понедельник, 2 июля 2018 г., 19:24:45 UTC+3 пользователь Anash P. Oommen (AdWords API Team) написал:

Anash P. Oommen (AdWords API Team)

unread,
Jul 3, 2018, 9:04:20 PM7/3/18
to AdWords API and Google Ads API Forum
Yep, your code should work.

Cheers
Anash P. Oommen,
AdWords API Advisor.

Константин Латыпов

unread,
Jul 4, 2018, 4:09:02 AM7/4/18
to AdWords API and Google Ads API Forum
Hi, Anash P. Oommen

This code will works for ProductPartitionNode
  partitionNode
   .addChild(emptyDimensionType)
   .asExcludedUnit();

And ProductPartition have no method   asExcludedUnit(); It only have: .setPartitionType(ProductPartitionType.UNIT);   
And this: emptyAdGroupCriterion.setCriterionUse(CriterionUse.NEGATIVE); . don't help.

Tell me please how can I add Excluded Other Case?

My code sample:

       batchJobHelper.uploadBatchJobOperations(operations, batchJob.getUploadUrl().getUrl());

     
---------------------------------
            ProductPartition productNode = new ProductPartition();
           productNode.setPartitionType(ProductPartitionType.UNIT);
           productNode.setCaseValue(dimensionType);
           productNode.setParentCriterionId(rootPartition.getId());
           productNode.setId(adGroup.getId() * 100000 - 1);

            // --- Create Others UNIT --------------------------
           ProductPartition emptyNode = new ProductPartition();
           emptyNode.setPartitionType(ProductPartitionType.UNIT);
           emptyNode.setCaseValue(emptyDimensionType);
           emptyNode.setParentCriterionId(rootPartition.getId());
           emptyNode.setId(adGroup.getId() * 100000 - 2);

            // --- Create Product ID UNIT --------------------------
           // Create BiddableAdGroupCriterion.
           BiddableAdGroupCriterion productAdGroupCriterion = new BiddableAdGroupCriterion();
           productAdGroupCriterion.setAdGroupId(adGroup.getId());
           productAdGroupCriterion.setCriterion(productNode);
           productAdGroupCriterion.setBiddingStrategyConfiguration(adGroup.getBiddingStrategyConfiguration());

            // Create AdGroupCriterionOperation.
           AdGroupCriterionOperation productOperation = new AdGroupCriterionOperation();
           productOperation.setOperand(productAdGroupCriterion);
           productOperation.setOperator(Operator.ADD);

            // Create BiddableAdGroupCriterion.
           BiddableAdGroupCriterion emptyAdGroupCriterion = new BiddableAdGroupCriterion();
           emptyAdGroupCriterion.setAdGroupId(adGroup.getId());
           emptyAdGroupCriterion.setCriterion(emptyNode);
           emptyAdGroupCriterion.setBiddingStrategyConfiguration(adGroup.getBiddingStrategyConfiguration());

            // Create AdGroupCriterionOperation.
           AdGroupCriterionOperation emptyOperation = new AdGroupCriterionOperation();
           emptyOperation.setOperand(emptyAdGroupCriterion);
           emptyOperation.setOperator(Operator.ADD);

            // Create BiddableAdGroupCriterion.
           BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion();
           biddableAdGroupCriterion.setAdGroupId(adGroup.getId());
           biddableAdGroupCriterion.setCriterion(rootPartition);

            // Create AdGroupCriterionOperation.
           AdGroupCriterionOperation rootOperation = new AdGroupCriterionOperation();
           rootOperation.setOperand(biddableAdGroupCriterion);
           rootOperation.setOperator(Operator.ADD);

            // Add to list.
           adGroupCriterionOperations.add(rootOperation);
           adGroupCriterionOperations.add(emptyOperation);
           adGroupCriterionOperations.add(productOperation);
       });
       return adGroupCriterionOperations;
   }



Best regards


среда, 4 июля 2018 г., 4:04:20 UTC+3 пользователь Anash P. Oommen (AdWords API Team) написал:

Константин Латыпов

unread,
Jul 5, 2018, 12:27:13 PM7/5/18
to AdWords API and Google Ads API Forum
Tell me please is it possible? (previous post)

среда, 4 июля 2018 г., 4:04:20 UTC+3 пользователь Anash P. Oommen (AdWords API Team) написал:

Константин Латыпов

unread,
Jul 6, 2018, 6:03:48 AM7/6/18
to AdWords API and Google Ads API Forum
Using NegativeAdGroupCriterion instead of BiddableAdGroupCriterion solve this issue.

Thank you

четверг, 5 июля 2018 г., 19:27:13 UTC+3 пользователь Константин Латыпов написал:
Reply all
Reply to author
Forward
0 new messages