Getting Error when creating assetGroupListingGroupFilters

206 views
Skip to first unread message

Abhishek Yadav

unread,
Aug 4, 2023, 6:30:37 AM8/4/23
to Google Ads API and AdWords API Forum
Hi ,

I am trying to create a Pmax Retail Campaign with selective products.

As i am trying and passing array of ProductItemIds to create assetGroupListingGroupFilters to create 1 node that will create UNIT INCLUDED .

But i am getting error below 

+"@type": "type.googleapis.com/google.ads.googleads.v12.errors.GoogleAdsFailure" +"errors": array:1 [ 0 => {#737 +"errorCode": {#736 +"fieldError": "REQUIRED" } +"message": "The required field was not present." +"location": {#741 +"fieldPathElements": array:3 [ 0 => {#738 +"fieldName": "operations" +"index": 0 } 1 => {#739 +"fieldName": "create" } 2 => {#740 +"fieldName": "parent_listing_group_filter" }

Google Ads API Forum Advisor

unread,
Aug 4, 2023, 9:32:01 AM8/4/23
to abhi...@conversios.io, adwor...@googlegroups.com

Hi,

Thank you for reaching out to Google Ads API Forum.

In order for us to investigate further the issue you are encountering, can you provide us with the complete API logs (request and response with request-id and request header) generated on your end when you encountered the issue? This is so we can check on our end as well and provide more appropriate guidance accordingly.

For the client libraries, logging can be enabled by navigating to the Client libraries > Your client library (ex Java) > Logging documentation, which you can access from this link (https://developers.google.com/google-ads/api/docs/client-libs). You can provide it via the Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

You may also refer to this guide (https://developers.google.com/google-ads/api/docs/performance-max/listing-groups) for Creating Shopping Listing Groups. Included in this guide is a code example that shows how to add product partitions to a Performance Max retail campaign.

Reference links included in this email:

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

Thanks,
 
Google Logo Google Ads API Team


Abhishek Yadav

unread,
Aug 7, 2023, 2:32:17 AM8/7/23
to Google Ads API and AdWords API Forum
Hi ,

I am using Google Ads REST API i am not using the client libraries.

i can add the request that i have done with code and response as well.

I am trying to create assetGroupListingFilters the concern is to create pmax campaign retail for selective products but getting the error : 

Request : 


 $customer_id = isset($postData['customer_id'])?$postData['customer_id']:"";        
        $header = array( "content-type: application/json",
        "Authorization: Bearer ".$access_token,
        "developer-token:".$this->credentials['web']['developer_token']);
        $url = $this->ads_api_url.'/customers/'.$customer_id.'/assetGroupListingGroupFilters:mutate';
        $data = array(
          "operations" => array(
            "create" => array(
              "vertical" => "SHOPPING",
              "assetGroup" => $resource_name_asset_groups,
              "resourceName" => "",
              "type"=> "UNIT_INCLUDED",
              "caseValue" => array("productItemId" => array('value' => "xxxxxx")),
            ),
           
          ),
          "validateOnly" => false,
          "responseContentType"=> "MUTABLE_RESOURCE"
        );            
        $ch = curl_init();        
        curl_setopt_array($ch, array(
          CURLOPT_URL => $url,
          CURLOPT_RETURNTRANSFER => true,
          CURLOPT_TIMEOUT => 0,
          CURLOPT_HTTPHEADER => $header,
          CURLOPT_POST => 1,
          CURLOPT_POSTFIELDS => json_encode($data)
        ));
        $response = curl_exec($ch);
        $response = json_decode($response);

        echo "asset Group filter obj";
        dd($response);


Getting error below : 


+"@type": "type.googleapis.com/google.ads.googleads.v12.errors.GoogleAdsFailure" +"errors": array:1 [ 0 => {#737 +"errorCode": {#736 +"fieldError": "REQUIRED" } +"message": "The required field was not present." +"location": {#741 +"fieldPathElements": array:3 [ 0 => {#738 +"fieldName": "operations" +"index": 0 } 1 => {#739 +"fieldName": "create" } 2 => {#740 +"fieldName": "parent_listing_group_filter" }

Google Ads API Forum Advisor

unread,
Aug 7, 2023, 7:49:31 AM8/7/23
to abhi...@conversios.io, adwor...@googlegroups.com

Hi,

Thanks for getting back to us.

I can see that you are trying to create a UNIT_INCLUDED. This type is used to indicate that the AssetGroupListingGroupFilter won't have children. Can you try setting the parentListingGroupFilter in your create operation in assetGroupListingGroupFilters.mutate? You can set this value as the resource name of the parent listing group subdivision. As per this guide regarding Creating Shopping Listing Groups, a subdivision introduces a new level in the tree, while units are leaves of the tree. 

I would recommend referring to this code example on Adding Performance Max Product Listing Group Tree as an additional reference in your code implementation. The provided code example is also available in PHP language.
 

Abhishek Yadav

unread,
Aug 7, 2023, 9:31:24 AM8/7/23
to Google Ads API and AdWords API Forum
Hi,

In that as per my scenario i have all products from which i need to create pmax retail campaign for specific products based on  productItemId so what i need to use or how the nodes to define i have checked the example even in that the all products are node is being created there isnt any example related to multi nodes creation based on the dimensions.

Google Ads API Forum Advisor

unread,
Aug 7, 2023, 1:45:28 PM8/7/23
to abhi...@conversios.io, adwor...@googlegroups.com

Hi,

Thanks for getting back with us.

With regards to your concern, kindly note that unit nodes can be created by passing an empty object of ListingDimensionInfo types to ListingGroupInfo. With that being said, you may use the dimensions and product partitions with the interactive guide for Performance Max campaigns. This interactive guide demonstrates how to create a standard or retail Performance Max campaign. Your inputs will be saved as you proceed through this guide. 

Let me know how this goes in your end.

Links included in this email:

Abhishek Yadav

unread,
Aug 9, 2023, 3:15:53 AM8/9/23
to Google Ads API and AdWords API Forum
Hi ,

As per the docs it was mentioned that we need to pass null in type to create root node and i have tried several times it is giving error regarding required filled .

I am not using the library i am using the REST API approach.

what is ListingGroupInfo  ?can you give details more i think as per my understanding that is used in ListingGroupFilters portion i tried but that isnt working and getting errors constantly.

Regarding the interactive guide that is generating for library based code as the approach mentioned i used but still getting the same error.

Google Ads API Forum Advisor

unread,
Aug 9, 2023, 7:00:40 AM8/9/23
to abhi...@conversios.io, adwor...@googlegroups.com

Hi,

Thanks for getting back to us.

In order for us to visualize what you are trying to do via the API, can you please share with us whole Google Ads UI screenshot (without cropping) of the data in the UI you are trying to set via API? You can provide it via the Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Additionally, you may also utilize the API explorer for the REST method assetGroupListingGroupFilters.mutate to test out your request.
 

Abhishek Yadav

unread,
Aug 14, 2023, 7:03:09 AM8/14/23
to Google Ads API and AdWords API Forum
Hi ,

I manually created the Asset Group in the google Ads UI i was able to differentiate the products based on the product Item Id and automatically it created Listing Groups with each ProductItemId.

In the private mail i dropped you the request ,response and other details.

Other than that i have added details in previous replies of the private email can you please check and revert back and Guide on the same its been week still the error still persists. 

Google Ads API Forum Advisor

unread,
Aug 14, 2023, 7:30:53 AM8/14/23
to abhi...@conversios.io, adwor...@googlegroups.com

Hi, 

Thank you for getting back to us.

With regards to your concern, please check this documentation (https://developers.google.com/google-ads/api/docs/performance-max/retail) for more information regarding PMax Retail Campaign. Furthermore, please refer to this guide (https://developers.google.com/google-ads/api/docs/performance-max/create-campaign) for the steps in creating a Performance Max Campaign.

Additionally, I understand that you have provided details for the request/response. However, for the error that you are encountering when using -1 values could you share the updated logs in this format (request and response with request-id and request header)I am asking this so we could have full visibility on the method you are using. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You may then send the requested information privately via the Reply to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com  alias instead.

Reference Links:

Reply all
Reply to author
Forward
0 new messages