Thanks for getting back to me again. I just want to say I appreciate your 
responses and deeply apologize as this is quite a complex and sensitive 
process given the constraints.

in your response:

   - You don't necessarily need to find and delete an "Others" node that 
   doesn't exist in your current tree. While the "Others" node captures 
   everything not explicitly covered by your subdivisions, it's automatically 
   created if it doesn't exist when you add a new subdivision.

Here are 3 separate examples (server-side logs) of trying to work with the 
API to convert a unit to a subdivision.
In each test I am:  In the 1st case, I pass just 2 objects (resource -1 & 
resource -2) as I was curious to see if I didn't add an "others" case, if 
it would be added. Each subsequent test I pass 3 objects to handle the 
"others" case.
*Note: To create this campaign with the Google Ads Api I had to have a root 
Node -> everything else root node -> brand node > everything else in brand 
node -> product_item_id node.*
 {
//*SUBDIVISION*
    entity: 'ad_group_criterion',
    operation: 'create',
    resource: {
      resource_name: 'customers/2595901092/adGroupCriteria/157149367644~-1',
      ad_group: 'customers/2595901092/adGroups/157149367644',
      listing_group: [Object],
      negative: false,
      status: 2
    }
  },
  {
// *UNIT*
    entity: 'ad_group_criterion',
    operation: 'create',
    resource: {
      resource_name: 'customers/2595901092/adGroupCriteria/157149367644~-2',
      ad_group: 'customers/2595901092/adGroups/157149367644',
      cpc_bid_micros: 400000,
      listing_group: [Object],
      negative: false,
      status: 2
    }
  },
  {
// *UNIT*
    entity: 'ad_group_criterion',
    operation: 'create',
    resource: v {
      ad_group: 'customers/2595901092/adGroups/157149367644',
      resource_name: 'customers/2595901092/adGroupCriteria/157149367644~-3',
      cpc_bid_micros: 400000,
      negative: false,
      status: 2,
      listing_group: [Object]
    }
  }

*case_value (in order):*
[
//brand
  { product_brand: { value: 'american fyre designs' } },

//everything else in brand - 1st test does not contain this.
  { product_brand: {} },

  {
// product under brand
    product_item_id: { value: 'shopify_us_5960181579931_37204494057627' }
  }
]
*Test 1 - Do not add 'Others Node' because it is "automatically created" 
according to the previous explanation (2 operations)*
Ed {
  errors: [
    Sd {
      error_code: { criterion_error: 108 },
      message: 'Subdivided listing groups must have an "others" case.',
      trigger: { int64_value: Long { low: -1, high: -1, unsigned: false } },
      location: [
    Pd { field_name: 'mutate_operations', index: 0 },
    Pd { field_name: 'ad_group_criterion_operation' },
    Pd { field_name: 'create' },
    Pd { field_name: 'listing_group' },
    Pd { field_name: 'type' }
  ],
    },
    Sd {
      error_code: { criterion_error: 106 },
      message: 'Ad group is invalid due to the listing groups it contains.',
      trigger: { int64_value: Long { low: -1, high: -1, unsigned: false } },
      location: [
    Pd { field_name: 'mutate_operations', index: 1 },
    Pd { field_name: 'ad_group_criterion_operation' },
    Pd { field_name: 'create' },
    Pd { field_name: 'listing_group' }
  ]
    }
  ],
request_id: '9V0lNLIqNwZz2PtuK5Dmtw'

*Test 2 - Add everything else node again with case_value: {} (empty 
object) *
Ed {
  errors: [
    Sd {
      error_code: criterion_error: 108,
      message: 'Subdivided listing groups must have an "others" case.',
      trigger: { int64_value: Long { low: -1, high: -1, unsigned: false } },
      location: [
    Pd { field_name: 'mutate_operations', index: 0 },
    Pd { field_name: 'ad_group_criterion_operation' },
    Pd { field_name: 'create' },
    Pd { field_name: 'listing_group' },
    Pd { field_name: 'type' }
  ],
    },
    Sd {
      error_code: { field_error: 2 },
      message: 'The required field was not present.',
      location: [
    Pd { field_name: 'mutate_operations', index: 1 },
    Pd { field_name: 'ad_group_criterion_operation' },
    Pd { field_name: 'create' },
    Pd { field_name: 'listing_group' },
    Pd { field_name: 'case_value' }
  ]
    },
    Sd {
      error_code: criterion_error: 106,
      message: 'Ad group is invalid due to the listing groups it contains.',
      trigger: { int64_value: Long { low: -1, high: -1, unsigned: false } },
      location: [
    Pd { field_name: 'mutate_operations', index: 2 },
    Pd { field_name: 'ad_group_criterion_operation' },
    Pd { field_name: 'create' },
    Pd { field_name: 'listing_group' }
  ]
    }
  ],
  request_id: 'iQhvrUQYbKU3Zpc6o2V84g'
}

*Test 3 - Set case_value property to empty object (i.e. product_brand: {} 
)  *
Ed {
  errors: [
    Sd {
      error_code: criterion_error: 108,
      message: 'Subdivided listing groups must have an "others" case.',
      trigger: { int64_value: Long { low: -1, high: -1, unsigned: false } },
      location: [
    Pd { field_name: 'mutate_operations', index: 0 },
    Pd { field_name: 'ad_group_criterion_operation' },
    Pd { field_name: 'create' },
    Pd { field_name: 'listing_group' },
    Pd { field_name: 'type' }
  ],
    },
    Sd {
      error_code: criterion_error: 110,
      message: 'Listing group cannot be added to the ad group because it 
already exists.',
      location: [
    Pd { field_name: 'mutate_operations', index: 1 },
    Pd { field_name: 'ad_group_criterion_operation' },
    Pd { field_name: 'create' },
    Pd { field_name: 'listing_group' }
  ]
    },
    Sd {
      error_code: criterion_error: 106,
      message: 'Ad group is invalid due to the listing groups it contains.',
      trigger: { int64_value: Long { low: -1, high: -1, unsigned: false } },
      location: [
    Pd { field_name: 'mutate_operations', index: 2 },
    Pd { field_name: 'ad_group_criterion_operation' },
    Pd { field_name: 'create' },
    Pd { field_name: 'listing_group' }
  ]
    }
  ],
  request_id: 'Ko3EEIBggXM-f63Pyu6ofw'
}

The only thing I can think of is that when I initially created the 
partitions, I did create a single brand partition as all products > brands 
> item id.  So, in that initial process I had to create an "others" brand 
node. Now when I try to add a new "others" node and its case_value : 
{product_brand: {} }, its conflicting with the existing one in the ad_group.

The question would then be why does the others node for (ex.  dimplex -> 
everything else in dimple) conflict with the attempt to create "american 
fyre design" -> everything else in "american fyre design"? And then if this 
is the case, what is the way to add another partition under that catch. 
This is becoming increasingly more likely to be the case in my opinion.

I went over to the Google Ads UI and added a subdivision to the UNIT node 
and came back on my app and logged the new tree based on case_value.

Included in the log are the brands, single brand catch-all and root:
[
  {
    product_brand: { value: 'fire magic' },
    product_condition: null,
    product_type: null,
    product_item_id: null
  },
  {
    product_brand: { value: 'dimplex' },
    product_condition: null,
    product_type: null,
    product_item_id: null
  },
  {}, <-- root
  {
    product_brand: { value: null }, <-- catch all 
    product_condition: null,
    product_type: null,
    product_item_id: null
  },
  {
    product_brand: { value: 'primo' },
    product_condition: null,
    product_type: null,
    product_item_id: null
  },
 //other product_item_ids
]

It seems this may be the case, but between the "listing group already 
exists" and the "must have others case", I am seeking advice.

Thanks again and I will keep trying to figure this out. 

regards,
Michael 

On Wednesday, February 21, 2024 at 6:53:05 AM UTC+7 Google Ads API Forum 
Advisor wrote:

> Hi,
>
> Thank you for getting back to us.
>
> After reviewing your concern, I understand that you’ve encountered an 
> LISTING_GROUP_ALREADY_EXISTS 
> <https://developers.google.com/google-ads/api/reference/rpc/v14/CriterionErrorEnum.CriterionError#:~:text=of%20its%20siblings.-,LISTING_GROUP_ALREADY_EXISTS,-Listing%20group%20cannot>
>  
> error. It means the listing group cannot be added to the ad group because 
> it already exists.
>
>
> *How do I find a node that doesn't currently exist in my active tree, 
> remove it and make sure I am not removing the wrong node? * 
>
>    - Please note that it is generally not recommended to delete nodes 
>    that don't exist in your active tree. Such attempts can lead to errors or 
>    unexpected behavior. 
>    - Please focus on creating the intended subdivision structure using 
>    the ad_group_criterion 
>    
> <https://developers.google.com/google-ads/api/fields/v15/ad_group_criterion> 
>    resource with appropriate listing group types and paths.  
>
> *Can you please confirm that I have to find the "other's node" and delete 
> it despite it not existing in my current tree? * 
>    
>    - You don't necessarily need to find and delete an "Others" node that 
>    doesn't exist in your current tree. While the "Others" node captures 
>    everything not explicitly covered by your subdivisions, it's automatically 
>    created if it doesn't exist when you add a new subdivision. 
>
> *I saw in your response that I should query the ad_group_criterion 
> resource? not the product_group_view? Is there a specific advantage using 
> the ad_group_criterion in this case?* 
>    
>    - Yes, querying the ad_group_criterion 
>    
> <https://developers.google.com/google-ads/api/fields/v15/ad_group_criterion> 
>    resource is generally recommended for managing listing groups and 
>    subdivisions within ad groups. This resource provides more specific and 
>    relevant information about individual ad_group 
>    <https://developers.google.com/google-ads/api/fields/v15/ad_group> 
>    criteria, including their listing group details. 
>    - The product_group_view 
>    
> <https://developers.google.com/google-ads/api/fields/v14/product_group_view> 
>    resource offers a broader view of product groups across campaigns, ad 
>    groups, and customer levels. 
>
>  Hope this helps. 
> This message is in relation to case "ref:!00D1U01174p.!5004Q02rzEgV:ref"
>
> Thanks,
>   
> [image: Google Logo] Google Ads API Team 
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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 the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/3d02dbae-bb85-4e60-b5b3-f9f92e6606c3n%40googlegroups.com.
  • Re... Jebron Lames
    • ... Jebron Lames
      • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
        • ... Jebron Lames

Reply via email to