"Listing Group UNIT node cannot have children" error when trying to add pmax listing group node

34 views
Skip to first unread message

charlesb...@gmail.com

unread,
Dec 4, 2022, 9:47:31 PM12/4/22
to Google Ads API and AdWords API Forum
Hi,

I'm getting the following error: Listing Group UNIT node cannot have children

Here's the python code:

_TEMPORARY_ID_LISTING_GROUP_ROOT = -1
operations = []

create_operation_factory = (
        AssetGroupListingGroupFilterCreateOperationFactory(
            client,
            customer_id,
            asset_group_id,
            _TEMPORARY_ID_LISTING_GROUP_ROOT,
        )
    )




new_dimension = client.get_type("ListingGroupFilterDimension")
new_dimension.product_condition.condition = (
)
operations.append(
    create_operation_factory.create_subdivision(
        '7914047195',#root id according to asset_group_listing_group_filter report (api call)
        create_operation_factory.next_id(),
        new_dimension,
    )
)
response = googleads_service.mutate(
        customer_id=customer_id, mutate_operations=operations
    )


Then note the current tree:

pmax root product group.png

As you can see, I'm working with the root node so should be able to add children.

I'm using create_subdivision here but I've tried create_unit too.


I thought the issue might be the wrong parent_id provided to the create_subdivision method (7914047195) but it's the only one available.

Thanks in advance.

Charles


Google Ads API Forum Advisor

unread,
Dec 5, 2022, 3:02:08 PM12/5/22
to charlesb...@gmail.com, adwor...@googlegroups.com
Hi Charles,

Thanks for reaching out and providing your code. Can you please privately provide us with the complete request and response logs so that our team can take a closer look? 

Thanks,

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2giWcE:ref

charlesb...@gmail.com

unread,
Dec 5, 2022, 4:50:13 PM12/5/22
to Google Ads API and AdWords API Forum
Private message sent. Thanks!

Google Ads API Forum Advisor

unread,
Dec 6, 2022, 2:00:54 PM12/6/22
to charlesb...@gmail.com, adwor...@googlegroups.com

Hi Charles,

Thanks for reaching out to the Google Ads API Support.

Upon checking your logs, it appears that the request logs have not been sent to our team. I can see that you have encountered an UNIT_CANNOT_HAVE_CHILDREN error. It indicates that the Listing Group UNIT node cannot have children. You may note that you may have to follow this code example for appropriate UNIT nodes and subdivisions as resources combined to form a hierarchy that creates a product partition tree. Also, make sure that AssetGroupListingGroupFilters must be removed in a specific order: all of the children of a filter must be removed before the filter itself, otherwise the API will return an error.

However, for you to see how to create listing groups with valid tree, you may refer to this page. You may need at least one unit node to make a tree valid. That unit can be the root node, which will become the "All Products" division. Until you have at least that root node, Performance Max will not serve retail ads. You may try again after validating your request, and let us know the results. If the issue still persists, our team requires recently tried complete logs in the format of the request and response logs along with the request-id generated via reply privately to author option.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2giWcE:ref
Message has been deleted

charlesb...@gmail.com

unread,
Dec 6, 2022, 6:09:12 PM12/6/22
to Google Ads API and AdWords API Forum
Hi,

Thanks for that.

Whilst I'm working out how to properly send the request and get the response can I just ask a question?

You mentioned this:
"Also, make sure that AssetGroupListingGroupFilters must be removed in a specific order: all of the children of a filter must be removed before the filter itself, otherwise the API will return an error."

Do I need to remove the nodes before I can add to them again? I should just re-build the whole tree?

When I follow the example you sent it works a treat when replace_existing_tree is True.

I.e. it works when I first create the root node then add to it.

Shouldn't I be able to:
 - Start with a root node
 - Remove the bit of code that creates the root node
 - Add the root node ID as the parent ID
 - And the rest of the units will be added?

No problem if not I just want to do it properly.

Thanks



On Tuesday, 6 December 2022 at 12:06:59 UTC-6 charlesb...@gmail.com wrote:
Hi,

Thanks for that.

Whilst I'm working out how to properly send the request and get the response can I just ask a question?

Do I need to remove the nodes before I can add to them again?

When I follow the example you sent it works a treat when replace_existing_tree is True.

I.e. it works when I first create the root node then add to it.

Shouldn't I be able to:
 - Start with a root node
 - Remove the bit of code that creates the root node
 - Add the root node ID as the parent ID
 - And the rest of the units will be added?

 Thanks
Reply all
Reply to author
Forward
0 new messages