Getting stcuk in making listing groups

168 views
Skip to first unread message

Tanish Gupta

unread,
Nov 30, 2023, 9:12:33 PM11/30/23
to Google Ads API and AdWords API Forum
Hi

I have a PMAX retail campign and i am not able to make listing groups in it :
Error: 
com.google.ads.googleads.v15.errors.GoogleAdsException: errors {
  error_code {
    asset_group_listing_group_filter_error: SUBDIVISION_MUST_HAVE_EVERYTHING_ELSE_CHILD
  }
  message: "Listing Group SUBDIVISION node must have everything else child."
  trigger {
    int64_value: -1
  }
  location {
    field_path_elements {
      field_name: "mutate_operations"
      index: 0
    }
    field_path_elements {
      field_name: "asset_group_listing_group_filter_operation"
    }
    field_path_elements {
      field_name: "create"
    }
    field_path_elements {
      field_name: "type"
    }
  }
}
errors {
  error_code {
    new_resource_creation_error: DUPLICATE_TEMP_IDS
  }
  message: "Creating more than one resource with the same temp ID is not allowed."
  trigger {
    int64_value: -1
  }
  location {
    field_path_elements {
      field_name: "mutate_operations"
      index: 1
    }
    field_path_elements {
      field_name: "asset_group_listing_group_filter_operation"
    }
    field_path_elements {
      field_name: "create"
    }
    field_path_elements {
      field_name: "resource_name"
    }
  }
}
request_id: "7SEJ-cM_WkxXs4MMg6_Q3A"


Code:

String assetGroupResourceName = "customers/2966251517/assetGroups/6483934165";
long assetGroupdId= Long.parseLong(assetGroupResourceName.substring(assetGroupResourceName.lastIndexOf("/") + 1));
mutateOperations.clear();
System.out.println("assetGroupResourceName" + assetGroupResourceName);
//AssetGroupListingGroupFilter.Builder listingGroupFilter = AssetGroupListingGroupFilter.newBuilder().setAssetGroup(assetGroupResourceName).setType(ListingGroupFilterTypeEnum.ListingGroupFilterType.SUBDIVISION).setListingSource(ListingGroupFilterListingSourceEnum.ListingGroupFilterListingSource.SHOPPING);
AssetGroupListingGroupFilter listingGroupFilter = AssetGroupListingGroupFilter.newBuilder()
.setResourceName(
ResourceNames.assetGroupListingGroupFilter(
Long.parseLong(saInfo.getAccountId()), assetGroupdId, -1))
.setAssetGroup(ResourceNames.assetGroup(Long.parseLong(saInfo.getAccountId()), assetGroupdId))
// Since this is the root node, do not set the ParentListingGroupFilter. For all other
// nodes, this would refer to the parent listing group filter resource name.
// .setParentListingGroupFilter("PARENT_FILTER_NAME")
//
// Unlike AddPerformanceMaxRetailCampaign, the type for the root node here must be
// SUBDIVISION because it will have child partitions under it.
.setType(ListingGroupFilterTypeEnum.ListingGroupFilterType.SUBDIVISION)
// Specifies that this uses the shopping listing source because it is a Performance
// Max campaign for retail.
.setListingSource(ListingGroupFilterListingSourceEnum.ListingGroupFilterListingSource.SHOPPING)
// Note the case_value is not set because it should be undefined for the root node.
.build();
//AssetGroupListingGroupFilterOperation.Builder listingGroupFilter1 = AssetGroupListingGroupFilterOperation.newBuilder().setCreate(listingGroupFilter);
AssetGroupListingGroupFilterOperation operation =
AssetGroupListingGroupFilterOperation.newBuilder().setCreate(listingGroupFilter).build();
System.out.println(operation);
MutateOperation.Builder mutateOperation1 = MutateOperation.newBuilder().setAssetGroupListingGroupFilterOperation(operation);
mutateOperations.add(mutateOperation1.build());
listingGroupFilter =
AssetGroupListingGroupFilter.newBuilder()
.setResourceName(
ResourceNames.assetGroupListingGroupFilter(Long.parseLong(saInfo.getAccountId()), assetGroupdId, 132))
.setAssetGroup(ResourceNames.assetGroup(Long.parseLong(saInfo.getAccountId()), assetGroupdId))
.setParentListingGroupFilter(
ResourceNames.assetGroupListingGroupFilter(Long.parseLong(saInfo.getAccountId()), assetGroupdId, -1))
// Uses the UNIT_INCLUDED type to indicate that the AssetGroupListingGroupFilter
// won't have children.
.setType(ListingGroupFilterTypeEnum.ListingGroupFilterType.UNIT_INCLUDED)
// Specifies that this uses the shopping listing source because it is a Performance
// Max campaign for retail.
.setListingSource(ListingGroupFilterListingSourceEnum.ListingGroupFilterListingSource.SHOPPING)
.setCaseValue(ListingGroupFilterDimension.newBuilder().setProductCustomAttribute(ListingGroupFilterDimension.ProductCustomAttribute.newBuilder().setValue("Everything else").setIndex(ListingGroupFilterCustomAttributeIndexEnum.ListingGroupFilterCustomAttributeIndex.INDEX0).build()).build())
.build();
AssetGroupListingGroupFilterOperation filterOperation =
AssetGroupListingGroupFilterOperation.newBuilder().setCreate(listingGroupFilter).build();
mutateOperation1 = MutateOperation.newBuilder().setAssetGroupListingGroupFilterOperation(operation);
mutateOperations.add(mutateOperation1.build());
System.out.println(getCampaignSharedSetService().mutate((mutateOperations), saInfo.getAccountId()));


Thanks
Tanish

Google Ads API Forum Advisor

unread,
Dec 1, 2023, 8:30:06 AM12/1/23
to tanish.gupta....@gmail.com, adwor...@googlegroups.com
Hi,

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

Upon checking the provided logs, I could see that you are getting the error "SUBDIVISION_MUST_HAVE_EVERYTHING_ELSE_CHILD". It means that the Listing Group SUBDIVISION node must have everything else child. Kindly note that 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 Product Condition: (Other) nodes are subdivisions. This tree structure with subdivisions and units lets you set bids at the unit level and also ensures that every product falls into one and only one unit node in the tree. 

I would suggest referring to our below guides that need to be followed to avoid issues on your end:  If the error still persists, kindly provide us with updated complete API logs (request and response with request-id and request header) generated at your end.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

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.!5004Q02qW0vu:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages