PRODUCT_PARTITION_DOES_NOT_EXIST when setCaseValue(new ProductBrand())

119 views
Skip to first unread message

mur...@aroxo.com

unread,
May 6, 2019, 10:34:10 AM5/6/19
to AdWords API and Google Ads API Forum
Hi

 Got the "PRODUCT_PARTITION_DOES_NOT_EXIST" issue when trying to partition the products in adgroup. followed the page https://developers.google.com/adwords/api/docs/guides/shopping#partitioning to create product partition through API.

PLease check the below code and suggest what should do here or anything wrong in my side?

$root = new ProductPartition();
$root->setPartitionType(ProductPartitionType::SUBDIVISION);
$root->setId(-1);
$productPartition1 = new ProductPartition();
$productPartition1->setPartitionType(ProductPartitionType::UNIT);
$productPartition1->setCaseValue(new ProductBrand(null, "adidas"));
$productPartition1 -> setParentCriterionId($root->getId());
$ProductPartition2 = new ProductPartition();
$ProductPartition2 -> setPartitionType(ProductPartitionType::UNIT);
$ProductPartition2 -> setCaseValue(new ProductBrand());
$ProductPartition2 -> setParentCriterionId($root->getId());
$criterion = new BiddableAdGroupCriterion();
        $biddingStrategyConfiguration = new BiddingStrategyConfiguration();
        $cpcBid = new CpcBid();
        $money = new Money();
        $money->setMicroAmount(500000);
        $cpcBid->setBid($money);
        $biddingStrategyConfiguration->setBids([$cpcBid]);

        $criterion->setBiddingStrategyConfiguration($biddingStrategyConfiguration);
        $criterion->setAdGroupId(72638726631);
        $criterion->setCriterion($productPartition1);

googleadsapi...@google.com

unread,
May 6, 2019, 3:29:00 PM5/6/19
to mur...@aroxo.com, AdWords API and Google Ads API Forum
Hi Bala,

Based on the error, it looks like the subdivision creation is failing as there is already a product partition. The subsequent nodes seems to fail as the subdivision creation failed. Could you please confirm if you were creating the ad group via Google Ads UI? If so, you will need to first remove the default product partition and then retry to create a new Product Partition. If you want to do this in a new ad group, you could create one via the API and then use this code sample as a reference to create the Product Partition. Please give this a try and let me know if you face any issues.

Thanks,
Bharani, Google Ads API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

mur...@aroxo.com

unread,
May 7, 2019, 1:39:23 AM5/7/19
to AdWords API and Google Ads API Forum
Hi

Didn't create AdGroup in UI. created the campaign in paused status through API then add AdGroup in that campiagn. then try to do the product partition by subdivition.

Now go to remove all campaigns and try again.

mur...@aroxo.com

unread,
May 7, 2019, 3:18:36 AM5/7/19
to AdWords API and Google Ads API Forum
Hi

Yes. removed all old campaigns which created through API. and create new campaign + adgroup thru API and use below link to add partition by productcanonicalcondition. its working good.

But what should do for partition the products in adgroup without condition. that is filter products for partition/group products using few brands/category/producttype/custom-labels/itemids (see attachement) in adgroup . we used the below coding. but its not working and got 
PRODUCT_PARTITION_DOES_NOT_EXIST even remove all campaigns which created through API



$root = new ProductPartition();
$root->setPartitionType(ProductPartitionType::SUBDIVISION);
$root->setId(-1);
$productPartition1 = new ProductPartition();
$productPartition1->setPartitionType(ProductPartitionType::UNIT);
$productPartition1->setCaseValue(new ProductBrand(null, "adidas"));
$productPartition1 -> setParentCriterionId($root->getId());
$ProductPartition2 = new ProductPartition();
$ProductPartition2 -> setPartitionType(ProductPartitionType::UNIT);
$ProductPartition2 -> setCaseValue(new ProductBrand());
$ProductPartition2 -> setParentCriterionId($root->getId());
$criterion = new BiddableAdGroupCriterion();
        $biddingStrategyConfiguration = new BiddingStrategyConfiguration();
        $cpcBid = new CpcBid();
        $money = new Money();
        $money->setMicroAmount(500000);
        $cpcBid->setBid($money);
        $biddingStrategyConfiguration->setBids([$cpcBid]);

        $criterion->setBiddingStrategyConfiguration($biddingStrategyConfiguration);
        $criterion->setAdGroupId(72638726631);
        $criterion->setCriterion($productPartition1);

On Tuesday, May 7, 2019 at 12:59:00 AM UTC+5:30, googleadsapi-forumadvisor wrote:
product groups-partition.png

googleadsapi...@google.com

unread,
May 7, 2019, 2:58:03 PM5/7/19
to mur...@aroxo.com, AdWords API and Google Ads API Forum
Hello Bala, 

Could you please share the SOAP request and response logs to investigate this further? You can share the details privately via Reply privately to author option.

Regards,
Bharani, Google Ads API Team

Bala Murugan

unread,
May 16, 2019, 11:01:36 AM5/16/19
to AdWords API and Google Ads API Forum
Hi

Thanks for you support. I want to edit or exclude the brand and include another one brand in the product group through API.

Can you please suggest how to do this? i find a remove keyword coding in php. but could not convert for brand. getting this error  

PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE 
brand in product group.png

googleadsapi...@google.com

unread,
May 16, 2019, 4:15:15 PM5/16/19
to AdWords API and Google Ads API Forum
Hello Bala, 

Please find the attached code snippet which creates the Product partition tree based on ProductBrand. Could you please give this a try and let us know if you have any questions?

Thanks,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:

http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

AddProductPartitionTree+copy.php

Bala Murugan

unread,
May 17, 2019, 10:33:49 AM5/17/19
to AdWords API and Google Ads API Forum
Hi

Sorry!I am not asking this. Did you check the attachment.

i need to do the exclusion and inclusion in product group through API. But could not find anything in API for this. Can you please send the PHP API page for this?

Google Ads API Forum Advisor Prod

unread,
May 20, 2019, 10:10:11 AM5/20/19
to mur...@aroxo.com, adwor...@googlegroups.com
Hi Bala, 

Regret the delay. You may use the AdGroupCriterionService.mutate() using both BiddableAdGroupCriterion to include and NegativeAdGroupCriterion to exclude. You may find the code samples here in PHP which includes the examples for both including and excluding the criteria. Please find the attached SOAP logs in Java as a reference which includes both the scenarios. Could you please take a look and give this a try? 

Thanks,
Bharani, Google Ads API Team

ref:_00D1U1174p._5001UApvH0:ref
Sample_Logs.rtf

Murugan

unread,
May 20, 2019, 10:14:46 AM5/20/19
to adsapifor...@gmail.com, adwor...@googlegroups.com

Hi,

 

                Thanks for the reply. Will check and let you know.

 

 

 

 

 

Thanks & Regards

Murugan.T

Aroxo Software Private Limited

 

This email (including any attachments) may contain confidential, proprietary, privileged and private information. The information is intended to be for the use of the individual or entity designated above. If you are not the intended recipient of this message or have received this information by mistake, please notify the sender immediately, and delete the message and any attachments. Any use, disclosure, reproduction or distribution of this message or any attachments to contains by an individual or entity other than the intended recipient is prohibited.

Bharani, Google Ads API TeamDescription: Image removed by sender.

ref:_00D1U1174p._5001UApvH0:ref

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/TaXSiYX5u1M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@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/0cuQE000000000000000000000000000000000000000000000PRT3CM00gDALOufEQeKGhekX2j8-sA%40sfdc.net.
For more options, visit https://groups.google.com/d/optout.

~WRD000.jpg
Reply all
Reply to author
Forward
0 new messages