Unable to create root listing group using google ads apis

117 views
Skip to first unread message

Tech Hotelzify

unread,
Aug 31, 2023, 11:13:45 AM8/31/23
to Google Ads API and AdWords API Forum
Context:
We have created ad group of type "HOTEL_ADS" using API for a campaign. Next we want to create the root hotel group so that we can have different categories of hotels (example based on Hotel Id) for each ad group.  Ref: create listing groups

We want the same hierarchy as seen in the google ads dashboard UI ( 'All hotels' (root subdivision) -> '1001', '1002').

Now, based on the google API v14 docs, we are using the AdGroupCriterion. Specifically we are using the type listing group to achieve our requirements. 

Problem:
Ideally, we first have to create a listing group of type 'SUBDIVISION' so that we can retrieve the criterion id, using this criterion id, we will have to add the individual hotel ids to the root groups.
When we execute this code, we get this error: 'to create the root subdivision listing group requires others case'. But to make the others case, we need the root criterion id, which obviously is not possible as the API is not allowing to create root listing group without the others case.

We also tried to create the root listing group with 'UNIT' type. The listing group got created and we got out root criterion id, but since its of type 'UNIT', we were not able to add children nodes ( hotel Ids in our case).

Tech stack:
- Node js
Google Ads Rest Interface V14 APIs

Is there a solution for this? 
Thanks

Google Ads API Forum Advisor

unread,
Aug 31, 2023, 5:53:05 PM8/31/23
to te...@hotelzify.com, adwor...@googlegroups.com

Hi there,

Thanks for reaching out to the Google Ads API Forum.

When creating a tree, you may need to specify the parent-child relationships between nodes. However, until a criterion has been created on the server we do not have a criterion ID with which to refer to it. Also, each node in the tree is either a subdivision or a unit, as defined by ListingGroupType. A subdivision introduces a new level in the tree, while units are leaves of the tree. Each subdivision must always be completely partitioned, so it must contain a node representing Other. In the example, the root and Hotel Class: (Other) nodes are subdivisions. This tree structure with subdivisions and units lets you set bids at the unit level and also ensures that every hotel listing falls into one and only one unit node in the tree.

That being said, you need at least one unit node in order to make a tree valid. To create a working tree, I recommend you make use of API explorer present on the right side of the page to build your JSON payload and send the REST API request through your Node JS program. 

This message is in relation to case "ref:_00D1U1174p._5004Q2o9pQG:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages