Retrieving Product Partition Data - SUBDIVISIONS & UNITS

90 views
Skip to first unread message

Jebron Lames

unread,
Jan 7, 2024, 7:51:10 PM1/7/24
to Google Ads API and AdWords API Forum
Hello,

I am currently working on a project where I need to construct a detailed, tree-like view of product partitions for shopping campaigns, including both subdivisions (intermediate nodes) and units (leaf nodes). 

I am in the process of retrieving listing_group data. I would like to know if there is a way to GET both SUBDIVISIONS and UNITS together. Or would I have to make two separate request and combine the data (someway on server-side or client)? 

My aim is to return the complete product partition tree for my currently active Google Ads Shopping campaigns. Right now I am under the impression I need to do both separately.

For Example I am using this query :
 SELECT
  ad_group_criterion.listing_group.type,
  ad_group_criterion.listing_group.case_value.product_type.level,
  ad_group_criterion.listing_group.case_value.product_type.value,
  ad_group_criterion.listing_group.case_value.product_item_id.value,
  ad_group_criterion.listing_group.parent_ad_group_criterion,
  ad_group_criterion.listing_group.path,
FROM ad_group_criterion
WHERE
  ad_group_criterion.listing_group.type = 'SUBDIVISION'  
  AND ad_group.id = ${adGroupId}

I mapped over the result and logged the object for listing_group.
(random numbers to remove my actual ids)

[
  {
    type: 2,
    case_value: null,
    parent_ad_group_criterion: 'customers/customerId/adGroupCriteria/1~6',
    path: xt { dimensions: [Array] }
  },
  {
    type: 2,
    case_value: null,
    parent_ad_group_criterion: null,
    path: xt { dimensions: [] }
  },
  {
    type: 2,
    case_value: { product_type: [Object], product_item_id: null },    
    parent_ad_group_criterion: 'customers/customerId/adGroupCriteria/1~6',
    path: xt { dimensions: [Array] }
  }
]

I then logged the paths: 
[
  [ Ut { product_brand: [Kt] } ],
  [],
  [ Ut { product_brand: [Kt] }, Ut { product_type: [Xt] } ]
]
My impression is this is the root node, brand node and product type node, which would then lead to my product_item_ids.

Is it possible to query both subdivisions and units in the results? 

Kind Regards,
Michael H.

Google Ads API Forum Advisor

unread,
Jan 8, 2024, 2:26:38 AM1/8/24
to dumbfr...@gmail.com, adwor...@googlegroups.com
Hi, 

Thank you for reaching out to the Google Ads API support team. 

By reviewing your concern, I understand that you're seeking a particular resource to retrieve both SUBDIVISIONS and UNITS concurrently within the listing_group data. Could you please confirm if you are able to retrieve this information from the Google Ads UI? If yes, I would request you to kindly provide an uncropped UI screenshot of the Google Ads account and highlight the fields that you want to retrieve via the API. 

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02rVC0B:ref"

Thanks,
 
Google Logo Google Ads API Team


Jebron Lames

unread,
Jan 15, 2024, 7:35:47 PM1/15/24
to Google Ads API and AdWords API Forum

I haven't got a reply, but I just wanted to let you know I figured it out. 

I had to query from the product_group_view which gives me a lot of resources to work with along side metrics.  In the query I included ad_group_criterion.listing_group.parent_ad_group_criterion and ad_group_criterion.criterion_id to check for parent-child relationships to create the hierarchy tree. You wonderful people at google are insane. 

Styles, converting the cpc to the millionth & alignments aside(...I'm working on it), this is what I was trying to achieve, and it was a lot easier to achieve querying from product_group_view. Not sure if it's the best approach, but this is how I did it. 

product_group_.png

regards,
Michael H.

Google Ads API Forum Advisor

unread,
Jan 16, 2024, 11:10:04 AM1/16/24
to dumbfr...@gmail.com, adwor...@googlegroups.com
Hi,

Hope you are doing well.

You can use 'product_group_view' to get parent-child relationships to create the hierarchy tree and it is also the best approach, as you can query 'Attributed resources' like ad_groupad_group_criterioncampaign and customer in this report. If you face any further issues, please feel free to reach out to us.
Reply all
Reply to author
Forward
0 new messages