Hi Gagan, assuming you have a working approach for adding a product partition tree, you should be able to continue using that. In order to update your product partition tree, you must remove the existing product partition tree and then replace it by adding a new one. I see no reason why you shouldn't be able to use the same approach when adding the new product partition tree. Keep in mind that a product partition tree is simply a collection of AdGroupCriteria that are linked together. In order to remove the existing product partition tree, you can select and remove all AdGroupCriteria for a given AdGroup with a Criterion of type PRODUCT_PARTITION. Then you should be able to use the same logic you used to build the original tree to add the new one. Please let me know if this works for you.
All the best,
Devin
The Google Ads API Team
Hi Gagan,
In order to retrieve all Ad Group Criteria for that campaign, you can use the get method of the AdGroupCriterionService. Here is a similar example but for CampaignCriteria . While the service you'll be using is different, the approach is similar. When constructing your selector, you'll need to specify the ad group you are targeting, as well as ad group criteria that have a criteria with a criterion of type PRODUCT_PARTITION. Then, you can use the mutate method on the AdGroupCriterionService to remove the relevant AdGroupCriteria.
All the best,
Devin
The Google Ads API Team