Updating AdGroup Ads failed with ADGROUP_LIMIT error

54 views
Skip to first unread message

Wenhui Jia

unread,
Jan 23, 2020, 9:19:41 PM1/23/20
to AdWords API and Google Ads API Forum
Using the following code to update an ads and the function call returns ADGROUP_LIMIT error..

The Python SDK we are using is "google-ads==4.1.1"
<code>
   client = GoogleAdsClient.load_from_storage()
   ad_group_ad_service = client.get_service('AdGroupAdService', version='v1')
   ad_group_ad_operation = client.get_type('AdGroupAdOperation', version='v1')

   ad_group_ad = ad_group_ad_operation.update
   ad_group_ad.resource_name = "customers/REDACTED/adGroupAds/REDACTED~REDACTED"
   ad_group_ad.status = client.get_type('AdGroupStatusEnum', version='v1').ENABLED
   fm = protobuf_helpers.field_mask(None, ad_group_ad)
   ad_group_ad_operation.update_mask.CopyFrom(fm)

   response = ad_group_ad_service.mutate_ad_group_ads(customer_id, [ad_group_ad_operation])
</code>

The following are the log message and exception from the above function call:

Request
-------
Method: /google.ads.googleads.v1.services.AdGroupAdService/MutateAdGroupAds
Headers: {
  "developer-token": "REDACTED",
  "x-goog-api-client": "gl-python/3.8.1 grpc/1.26.0 gax/1.16.0 gapic/4.1.1"
}
Request: customer_id: "REDACTED"
operations {
  update {
    resource_name: "customers/REDACTED/adGroupAds/REDACTED~REDACTED"
    status: ENABLED
  }
  update_mask {
    paths: "resource_name"
    paths: "status"
  }
}


Response
-------
Headers: {
  "google.ads.googleads.v1.errors.googleadsfailure-bin": "\n\u0002\n\u0003\u0003\u0004\u0012\u0001Indicates that this request would exceed the number of allowed resources in an ad group. The exact resource type and limit being checked can be inferred from accountLimitType, and the numeric id of the ad group involved is given by enclosingId.\u001a\b*\u0006<null>\"\u0010\u0012\u000e\n\noperations\u0012\u0000",
  "grpc-status-details-bin": "\b\u0003\u0012%Request contains an invalid argument.\u001a\u0002\nCtype.googleapis.com/google.ads.googleads.v1.errors.GoogleAdsFailure\u0012\u0002\n\u0002\n\u0003\u0003\u0004\u0012\u0001Indicates that this request would exceed the number of allowed resources in an ad group. The exact resource type and limit being checked can be inferred from accountLimitType, and the numeric id of the ad group involved is given by enclosingId.\u001a\b*\u0006<null>\"\u0010\u0012\u000e\n\noperations\u0012\u0000",
  "request-id": "REDACTED"
}
Fault: errors {
  error_code {
    resource_count_limit_exceeded_error: ADGROUP_LIMIT
  }
  message: "Indicates that this request would exceed the number of allowed resources in an ad group. The exact resource type and limit being checked can be inferred from accountLimitType, and the numeric id of the ad group involved is given by enclosingId."
  trigger {
    string_value: "<null>"
  }
  location {
    field_path_elements {
      field_name: "operations"
      index {
      }
    }
  }
}

What does the error code mean? Which resource does it refer to? Is this AdGroup contains too many ads? What is the limit?

Google Ads API Forum Advisor Prod

unread,
Jan 24, 2020, 11:22:07 AM1/24/20
to wj...@zulily.com, adwor...@googlegroups.com
Hi Wenhui,

Thank you for reaching out. Can you please share the un-censored detailed logs via reply privately to author so that I can further investigate the issue? The ADGROUP_LIMIT error occurs when the call would exceed the number of resources in an ad group. The limits can be found here.

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5001USwxFr:ref
Reply all
Reply to author
Forward
0 new messages