Hi Eric,

I'm afraid I ran my tests in a different programming language, namely Ruby. 
In any case, it's a simple case of constructing a mutate request for the 
AdGroupCriterion, with

operation: "REMOVE"
operand: a BiddableAdGroupCriterion with the adGroupId set to the ad group 
ID in question, and a criterion with the id set to the criterion ID in 
question. In (hopefully readable) Ruby:

operation = {
  :operator => 'REMOVE',
  :operand => {
    :xsi_type => 'BiddableAdGroupCriterion',
    :ad_group_id => ad_group_id,
    :criterion => {
      :id => criterion_id
    }
  }
}

If you're still getting errors after replicating the above in .NET let me 
know and I'll contact you privately so we can look at your SOAP logs.

As for the sample code, it's my team that writes it, and I'm sorry to hear 
you found it lacking. We'll see what you can do about providing some more 
samples for the Shopping use cases.

Cheers,
Sérgio

---
Sérgio Gomes
Developer Relations

Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 
9TQ
Registered in England Number: 3977902


On Thursday, 14 August 2014 15:13:04 UTC+1, road11 wrote:
>
> Sergio,
>
> Thank you for your kind response. Is there any way you could please post 
> your C#.Net code (or VB.Net, for that matter) that you are using to get 
> this done? No matter what I throw at it, I keep getting an error message 
> saying I am not allowed to perform this operation for a Shopping campaign. 
>
> And could you please pass along to the dev team how frustrating it is to 
> have code samples that do not show how to perform edits and deletes? 
> Shopping is the first API Google has ever released that did not provide the 
> entire CRUD (create, read, update, delete) spectrum in the published sample 
> code. There would be far fewer questions on the forums if they would have 
> done that very basic thing.
>
> Thanks,
>
> Eric
>
> On Monday, August 11, 2014 4:32:43 AM UTC-4, Sérgio Gomes (Shopping API 
> Team) wrote:
>>
>> Hi Eric,
>>
>> Yes, I'm deleting the default subdivision partition. The ID is shared 
>> among all ad groups, as you say, but remember that by deleting an ad group 
>> criterion you're deleting inside a specific ad group 
>> (AdGroupCriterion.mutate takes both the ad group ID and the criterion ID), 
>> so you won't be deleting anything in other ad groups.
>>
>> As for the tree being in an inconsistent state, that doesn't seem to be 
>> the case, since you can see it in the UI (you'd be getting errors 
>> otherwise), so it's probably just a case of deleting the root node and 
>> calling it a day.
>>
>> Cheers,
>> Sérgio
>>
>> ---
>> Sérgio Gomes
>> Developer Relations
>>
>> Google UK Limited
>> Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 
>> 9TQ
>> Registered in England Number: 3977902
>>
>> On Saturday, 9 August 2014 03:05:33 UTC+1, road11 wrote:
>>>
>>> Sergio,
>>>
>>> Thanks for your response. In all of my trees, I have only 3 partitions: 
>>> the default subdivision partition, the sku partition that I bid on (type 
>>> UNIT), and the "everything else" partition, which I've set up to be 
>>> Excluded, making it a NegativeAdGroupCriterion, which is also a UNIT type. 
>>> I can't seem to delete any of them successfully. Are you saying you're 
>>> deleting the default "all products" partition? That partition's ID seems to 
>>> be shared among all my adGroups (all my adGroups' default partitions have 
>>> that same ID).
>>>
>>> If my tree were in an inconsistent state, how would I know? It looks the 
>>> same in the UI as it does had I created it in the UI, itself. Would it help 
>>> if I posted the C# code I used to create the tree? 
>>>
>>> Eric
>>>
>>> On Friday, August 8, 2014 6:57:40 AM UTC-4, Sérgio Gomes (Shopping API 
>>> Team) wrote:
>>>>
>>>> Hi Eric,
>>>>
>>>> I'm afraid I'm having trouble replication your issue locally. I've set 
>>>> up a partition tree with a NegativeAdGroupCriterion and had no trouble 
>>>> deleting the whole thing by just deleting the base node.
>>>>
>>>> Perhaps the tree you're testing this with is in an inconsistent state? 
>>>> Could you try creating a new one and testing there?
>>>>
>>>> Cheers,
>>>> Sérgio
>>>>
>>>> ---
>>>> Sérgio Gomes
>>>> Developer Relations
>>>>
>>>> Google UK Limited
>>>> Registered Office: Belgrave House, 76 Buckingham Palace Road, London 
>>>> SW1W 9TQ
>>>> Registered in England Number: 3977902
>>>>
>>>>
>>>> On Wednesday, 6 August 2014 16:09:22 UTC+1, road11 wrote:
>>>>>
>>>>> Viewing previous posts on this topic, I've decided it would be easier 
>>>>> just to delete my partition tree and create a new one. However, I get an 
>>>>> error when I try. I've created operations of type REMOVE in the 
>>>>> ProductPartitionHelper.cs class like so (very similar to the ...
>>>>>
>>>>>         public void CreateRemoveOperation(AdGroupCriterion criterion)
>>>>>         {
>>>>>             criterion.adGroupId = this.adGroupId;
>>>>>             AdGroupCriterionOperation operation = new 
>>>>> AdGroupCriterionOperation();
>>>>>             operation.operand = criterion;
>>>>>             operation.@operator = Operator.REMOVE;
>>>>>             this.operations.Add(operation);
>>>>>         }
>>>>>
>>>>> Then I get all the Partitions in the adGroup. There are 3 of them in 
>>>>> my case: the default partition (type SUBDIVISION), the partition I want 
>>>>> to 
>>>>> bid on (type UNIT), and the "everything else" partition (also type UNIT). 
>>>>> Then I loop through them to create delete operations using the 
>>>>> ProductPartitionHelper, followed by the mutate operation, like so...
>>>>>
>>>>>             List<AdGroupCriterion> list = 
>>>>> GetCriteriaForShoppingAdGroup(adGroupID);
>>>>>             Debug.WriteLine(list.Count);
>>>>>             ProductPartitionHelper helper = new 
>>>>> ProductPartitionHelper(adGroupID); 
>>>>>             foreach (AdGroupCriterion cri in list)
>>>>>             {               
>>>>>                 helper.CreateRemoveOperation(cri);
>>>>>             }           
>>>>>
>>>>>             AdGroupCriterionService adGroupCriterionService =
>>>>>                 (AdGroupCriterionService)user.GetService(
>>>>>                 AdWordsService.v201406.AdGroupCriterionService);
>>>>>             try
>>>>>             {
>>>>>                 adGroupCriterionService.mutate(helper.Operations);
>>>>>             }            
>>>>>             catch (Exception ex)
>>>>>             {
>>>>>                 Debug.WriteLine(ex.Message);
>>>>>                 if (ex.InnerException != null)
>>>>>                 {
>>>>>                     Debug.WriteLine("Inner Exception:" + 
>>>>> ex.InnerException.Message);                    
>>>>>                 }
>>>>>             }
>>>>>
>>>>> ...it chokes on the mutate method with this: Inner 
>>>>> Exception:[AdGroupCriterionError.PRODUCT_PARTITION_DOES_NOT_EXIST @ 
>>>>> operations[1].operand.criterion.id, 
>>>>> AdGroupCriterionError.PRODUCT_PARTITION_DOES_NOT_EXIST @ operations[2].
>>>>> operand.criterion.id]
>>>>>
>>>>> the third partition in this tree, the "everything else" partition, 
>>>>> (the one represented by operations[2]) is excluded, hence the Google API 
>>>>> gave it a type of NegativeAdGroupCriterion (criterionUse = "NEGATIVE"). 
>>>>>
>>>>> So, since it thinks this partition doesn't exist, I tried passing only 
>>>>> the first two, omitting the 3rd. When I do that, I get the same error:
>>>>> Inner 
>>>>> Exception:[AdGroupCriterionError.PRODUCT_PARTITION_DOES_NOT_EXIST @ 
>>>>> operations[1].operand.criterion.id]
>>>>>
>>>>> ...that operation is represented by the real product I'm bidding on, 
>>>>> and it most assuredly does exist. I can verify this by downloading the 
>>>>> report from the UI for the adGroup and comparing criterion ID's. It's 
>>>>> definitely a product partition with a criterion type of BIDDABLE.
>>>>>
>>>>> Finally, I tried removing just the root partition. I had seen earlier 
>>>>> Josh indicated that removing that partition performs a cascading delete. 
>>>>> However, when I do that, I get this exception: 
>>>>> Inner 
>>>>> Exception:[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE
>>>>>  
>>>>> @ operations[0].operand.userStatus; trigger:'SHOPPING', 
>>>>> OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE @ 
>>>>> operations[0].operand.biddingStrategyConfiguration.biddingScheme; 
>>>>> trigger:'SHOPPING', 
>>>>> OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE @ 
>>>>> operations[0].operand.biddingStrategyConfiguration.biddingStrategyType; 
>>>>> trigger:'SHOPPING']
>>>>>
>>>>>
>>>>>  So, can somebody from the adwords team set me straight? How do you 
>>>>> delete a partition tree out of an adGroup through the API that contains 
>>>>> an 
>>>>> excluded partition (all of ours do)? It doesn't seem to like anything I 
>>>>> throw at it.
>>>>>
>>>>> Eric
>>>>>
>>>>>
>>>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to