You can - but due to the nature of how product trees exist, you have to 
ensure every mutate results in a valid resulting tree, else the call will 
fail.

You can use a similar method to 'remove' product groups.

Note - due to a size limit, you may not be able to perform too many changes 
at a time else the calls will fail.  When I remove product groups, I submit 
mutate requests with each pass - unlike with the creation, where I submit 
many in a single mutate.
==

You can do bid arguments with the same style- using "SET" as Peter stated.


On Saturday, June 15, 2019 at 9:19:46 PM UTC-5, CDG wrote:
>
> hi Kevin,
>
> Thank you for your answer.
> ,
> I am currently able to create tree content and add it to the Google 
> advertising product group through examples and your responses.
>
> I want to ask is, is there any way to modify the created tree?
>
> Kevin Weitzner於 2019年6月13日星期四 UTC+8上午12時45分33秒寫道:
>>
>> Do you still need help with this?  Here is some example in code from one 
>> of my python scripts
>>
>> adgroup_criterion_service = client.GetService(
>>     'AdGroupCriterionService', version='v201809')
>>
>> selector = {
>>   'fields':['ParentCriterionId'],
>>     'predicates':[
>>         {
>>             'field':'AdGroupId',
>>             'operator': 'EQUALS',
>>             'values': adgroup_id
>>         }
>>     ]
>> }
>> page = adgroup_criterion_service.get(selector)
>>
>> parent = page['entries'][0]['criterion']
>>
>>
>> helper = ProductPartitionHelper(adgroup_id)
>> #root = helper.CreateSubdivision()
>>
>> for pla in PLAList:
>>     new_product = {
>>         'xsi_type' : 'ProductOfferId',
>>         'value' : ''
>>     }
>>     new_product['value'] = pla
>>     #helper.CreateUnit(self,parent=parent, new_product, 200000)
>>     helper.CreateUnit(parent=parent,value=new_product,bid_amount=20000)
>>
>> other_products = {
>>     'xsi_type': 'ProductOfferId',
>> }
>>
>> #helper.CreateUnit(
>> #    root, other_products)
>>
>> # Make the mutate request
>> result = adgroup_criterion_service.mutate(helper.GetOperations())
>>
>>
>> ---
>>
>>
>> You need to use the adgroup_criterion_service get on the parentcriterionID 
>> to get the tree, then mutate the tree.  
>>
>>
>> I iterate through my list of Ids to add "for pla in PLAList" -- note you 
>> cannot add more than 5000~ in a single mutate -- and there are limits to how 
>> large the tree can be - if you exceed something like 12-13k it will give an 
>> exception.
>>
>> --
>>
>>
>> Hope this helps you out - it took me a while to understand how to manipulate 
>> these.  The example only works for creating the tree, so it errors if you 
>> try to do it where one already exists.
>>
>>
>>
>>
>> On Sunday, June 9, 2019 at 10:25:27 PM UTC-5, CDG wrote:
>>>
>>> Hello there
>>> I am using the python example to create Product Partition trees
>>>
>>> Now
>>> I want to update the tree, but I always get the error.
>>>
>>> --
>>> 'trigger': None,
>>> 'errorString': 'AdGroupCriterionError.PRODUCT_PARTITION_ALREADY_EXISTS',
>>> 'ApiError.Type': 'AdGroupCriterionError',
>>> 'reason': 'PRODUCT_PARTITION_ALREADY_EXISTS'
>>> ---
>>>
>>> help me to solve the problem, thanks.
>>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a621d06e-c44a-4875-8d00-1b41cae89cf3%40googlegroups.com.

Reply via email to