Unable to create product partition

330 views
Skip to first unread message

jhufg....@yahoo.co.in

unread,
Mar 15, 2016, 9:08:07 AM3/15/16
to AdWords API Forum, tejendr...@snapdeal.com
I am getting  following error while creating product partition 

AdGroupCriterionError</ApiError.Type>
                        <reason>PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE 
following is the java code i am using for making product partition 

ProductPartitionTree partitionTree = ProductPartitionTree
.createAdGroupTree(adWordsServices, adWordsSession, adGroupId);

System.out.printf("Original tree:%n%s%n", partitionTree);
ProductPartitionNode rootNode = partitionTree.getRoot().asSubdivision();
rootNode.addChild(ProductDimensions.createOfferId(pogId.toString()))
.asBiddableUnit().setBid(bidAmount);

AdGroupCriterionServiceInterface adGroupCriterionService = adWordsServices
.get(adWordsSession, AdGroupCriterionServiceInterface.class);
java.util.List<AdGroupCriterionOperation> mutateOperations = partitionTree
.getMutateOperations();
if (mutateOperations.isEmpty()) {
System.out
.println("Skipping the mutate call because the original tree and the current tree "
+ "are logically identical.");
} else {
adGroupCriterionService.mutate(mutateOperations
.toArray(new AdGroupCriterionOperation[0]));
}

Soap Response/Request :

    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201601" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>34534634643</ns1:clientCustomerId>
            <ns1:developerToken>segsegsegrhgerher</ns1:developerToken>
            <ns1:userAgent>gergerger (AwApi-Java, AdWords-Axis/2.10.0, Common-Java/2.10.0, Axis/1.4, Java/1.7.0_95, maven)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns2:BiddableAdGroupCriterion">
                    <adGroupId>26675539979</adGroupId>
                    <criterion xsi:type="ns2:ProductPartition">
                        <id>-1</id>
                        <partitionType>SUBDIVISION</partitionType>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns3="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns3:BiddableAdGroupCriterion">
                    <adGroupId>26675539979</adGroupId>
                    <criterion xsi:type="ns3:ProductPartition">
                        <id>-2</id>
                        <partitionType>UNIT</partitionType>
                        <parentCriterionId>-1</parentCriterionId>
                        <caseValue xsi:type="ns3:ProductOfferId">
                            <value>112431</value>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>

2016-03-15 18:34:14 WARN  soapXmlLogger:85 - SOAP Response:
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201601">
            <requestId>00052e1608b322880a4c4d66e60dfa75</requestId>
            <serviceName>AdGroupCriterionService</serviceName>
            <methodName>mutate</methodName>
            <operations>2</operations>
            <responseTime>118</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[RequiredError.REQUIRED @ operations[1].operand.biddingStrategyConfiguration, AdGroupCriterionError.PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE @ operations; 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}']</faultstring>
            <detail>
                <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201601">
                    <message>[RequiredError.REQUIRED @ operations[1].operand.biddingStrategyConfiguration, AdGroupCriterionError.PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE @ operations; 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}']</message>
                    <ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError">
                        <fieldPath>operations[1].operand.biddingStrategyConfiguration</fieldPath>
                        <trigger/>
                        <errorString>RequiredError.REQUIRED</errorString>
                        <ApiError.Type>RequiredError</ApiError.Type>
                        <reason>REQUIRED</reason>
                    </errors>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AdGroupCriterionError">
                        <fieldPath>operations</fieldPath>
                        <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}</trigger>
                        <errorString>AdGroupCriterionError.PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE</errorString>
                        <ApiError.Type>AdGroupCriterionError</ApiError.Type>
                        <reason>PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>



Yin Niu

unread,
Mar 15, 2016, 10:17:44 AM3/15/16
to AdWords API Forum, tejendr...@snapdeal.com
Hello, 

Please review our shopping campaign guide and the slides.  Every "subdivision" should always have a "Others" unit in addition to the units with specific criteria.

In the UI, this is the "Everything else in...." entry.

Cheers,
Yin, AdWords API Team. 

jhufg....@yahoo.co.in

unread,
Mar 15, 2016, 10:06:50 PM3/15/16
to AdWords API Forum
Hi yin ,
 I have added the other node with product dimension null 
rootNode.addChild(ProductDimensions.createOfferId(null)).asExcludedUnit();

Now i am getting different error 

 <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError">
                        <fieldPath>operations[1].operand.biddingStrategyConfiguration</fieldPath>
                        <trigger/>
                        <errorString>RequiredError.REQUIRED</errorString>
                        <ApiError.Type>RequiredError</ApiError.Type>
                        <reason>REQUIRED</reason>
                    </errors>
                </ApiExceptionFault>

jhufg....@yahoo.co.in

unread,
Mar 16, 2016, 2:58:45 AM3/16/16
to AdWords API Forum
soap response and request


<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201601" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>885-fwef-7414</ns1:clientCustomerId>
            <ns1:developerToken>fwefw</ns1:developerToken>
            <ns1:userAgent>fewfwe (AwApi-Java, AdWords-Axis/2.10.0, Common-Java/2.10.0, Axis/1.4, Java/1.7.0_95, maven)</ns1:userAgent>
                <operand xmlns:ns4="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns4:NegativeAdGroupCriterion">
                    <adGroupId>26675539979</adGroupId>
                    <criterion xsi:type="ns4:ProductPartition">
                        <id>-3</id>
                        <partitionType>UNIT</partitionType>
                        <parentCriterionId>-1</parentCriterionId>
                        <caseValue xsi:type="ns4:ProductOfferId"/>
                    </criterion>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>

2016-03-16 12:08:38 WARN  soapXmlLogger:85 - SOAP Response:
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201601">
            <requestId>00052e24c38945980a4c46ea810a5c0f</requestId>
            <serviceName>AdGroupCriterionService</serviceName>
            <methodName>mutate</methodName>
            <operations>3</operations>
            <responseTime>94</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[RequiredError.REQUIRED @ operations[1].operand.biddingStrategyConfiguration]</faultstring>
            <detail>
                <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201601">
                    <message>[RequiredError.REQUIRED @ operations[1].operand.biddingStrategyConfiguration]</message>
                    <ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError">
                        <fieldPath>operations[1].operand.biddingStrategyConfiguration</fieldPath>
                        <trigger/>
                        <errorString>RequiredError.REQUIRED</errorString>
                        <ApiError.Type>RequiredError</ApiError.Type>
                        <reason>REQUIRED</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

Yin Niu

unread,
Mar 16, 2016, 10:07:35 AM3/16/16
to AdWords API Forum
Hello, 

Please see this forum discussion on how to create an "other" node. 

Thanks,
Yin, AdWords API Team. 

jhufg.567484

unread,
Jun 23, 2016, 4:26:31 AM6/23/16
to AdWords API Forum
Hi Yin,

Unable to create product partition tree .please send the following soap request and response 



SOAP error response 



<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201601">
            <requestId>000535eba2a36c180a626d027b0e74b6</requestId>
            <serviceName>AdGroupCriterionService</serviceName>
            <methodName>mutate</methodName>
            <operations>8</operations>
            <responseTime>280</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[RequiredError.REQUIRED @ operations[4].operand.biddingStrategyConfiguration]</faultstring>
            <detail>
                <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201601">
                    <message>[RequiredError.REQUIRED @ operations[4].operand.biddingStrategyConfiguration]</message>
                    <ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError">
                        <fieldPath>operations[4].operand.biddingStrategyConfiguration</fieldPath>
                        <trigger/>
                        <errorString>RequiredError.REQUIRED</errorString>
                        <ApiError.Type>RequiredError</ApiError.Type>
                        <reason>REQUIRED</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>



SOAP request:


    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201601" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>866-dw-4403</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>dwdw (AwApi-Java, AdWords-Axis/2.15.0, Common-Java/2.15.0, Axis/1.4, Java/1.7.0_80, maven, ProductPartitionTree, SelectorBuilder)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <operations>
                <operator>REMOVE</operator>
                <operand>
                    <adGroupId>29789572975</adGroupId>
                    <criterion xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns2:ProductPartition">
                        <id>18283950120</id>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns3="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns3:BiddableAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns3:ProductPartition">
                        <id>-1</id>
                        <partitionType>SUBDIVISION</partitionType>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns4="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns4:BiddableAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns4:ProductPartition">
                        <id>-2</id>
                        <partitionType>SUBDIVISION</partitionType>
                        <parentCriterionId>-1</parentCriterionId>
                        <caseValue xsi:type="ns4:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_1</type>
                            <value>gm120</value>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns5="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns5:BiddableAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns5:ProductPartition">
                        <id>-3</id>
                        <partitionType>SUBDIVISION</partitionType>
                        <parentCriterionId>-2</parentCriterionId>
                        <caseValue xsi:type="ns5:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_2</type>
                            <value>Electronics</value>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns6="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns6:BiddableAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns6:ProductPartition">
                        <id>-4</id>
                        <partitionType>UNIT</partitionType>
                        <parentCriterionId>-3</parentCriterionId>
                        <caseValue xsi:type="ns6:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_3</type>
                            <value>Electronics</value>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns7="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns7:NegativeAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns7:ProductPartition">
                        <id>-5</id>
                        <partitionType>UNIT</partitionType>
                        <parentCriterionId>-3</parentCriterionId>
                        <caseValue xsi:type="ns7:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_3</type>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns8="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns8:NegativeAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns8:ProductPartition">
                        <id>-6</id>
                        <partitionType>UNIT</partitionType>
                        <parentCriterionId>-2</parentCriterionId>
                        <caseValue xsi:type="ns8:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_2</type>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns9="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns9:NegativeAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns9:ProductPartition">
                        <id>-7</id>
                        <partitionType>UNIT</partitionType>
                        <parentCriterionId>-1</parentCriterionId>
                        <caseValue xsi:type="ns9:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_1</type>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>


Please help yin, i am  looking this issue  for couple of days .


Regads,
Tejendra 

Joyce Lava

unread,
Jun 23, 2016, 4:45:41 AM6/23/16
to AdWords API Forum
Hi Tejendra,

I saw that there is a new thread for the above concern. Let us continue the discussion in the new thread.

Thanks,
Joyce, AdWords API Team
Reply all
Reply to author
Forward
0 new messages