Ads API: RESOURCE_NOT_FOUND when removing existing AdGroupCriterionOperation

728 views
Skip to first unread message

Linas Medžiūnas

unread,
Oct 4, 2019, 4:10:24 AM10/4/19
to AdWords API and Google Ads API Forum
Hi,

1. I'm fetching AdGroupCriterion of some Hotel with the query:
SELECT ad_group_criterion.resource_name
FROM ad_group_criterion
WHERE ad_group_criterion
.listing_group.case_value.hotel_id.value = 'bc1f979e-0d69-4363-80a1-9b3e76c52b35'


2. The query results are:
"ad_group_criterion {  resource_name: "customers/1038314460/adGroupCriteria/79476509951~796560777108"}",
"ad_group_criterion {  resource_name: "customers/1038314460/adGroupCriteria/79476509951~859424928717"}"


3. Now, I need to remove these resources. I try to do that with:
var op = AdGroupCriterionOperation.newBuilder.setRemove("customers/1038314460/adGroupCriteria/79476509951~859424928717").build
client
.mutateAdGroupCriteria("1038314460", Collections.singletonList(op))
(all using Google Ads API client for Java, version 4.2.0)

And removal fails with error messages:
ex=[c.g.a.g.v.e.GoogleAdsException], errors {
error_code
{
mutate_error
: RESOURCE_NOT_FOUND
}
message
: "Resource was not found."
trigger
{
string_value
: "CriterionId{id=859424928717}"
}
location
{
field_path_elements
{
field_name
: "operations"
index
{
}
}
field_path_elements
{
field_name
: "remove"
}
}
}

FAILURE REQUEST SUMMARY. Method: google.ads.googleads.v2.services.AdGroupCriterionService/MutateAdGroupCriteria, Endpoint: googleads.googleapis.com:443, CustomerID: 1038314460, RequestID: -WRXeE5g1hQCavPpJqBy0w, ResponseCode: INVALID_ARGUMENT, Fault: Request contains an invalid argument..

What am I doing wrong here?

Thanks, Linas

Google Ads API Forum Advisor Prod

unread,
Oct 4, 2019, 4:53:16 PM10/4/19
to adwor...@googlegroups.com
Hello, 

We are taking a look into this issue. We will have an update for you soon. 

Thanks,
Bharani, Google Ads API Team

ref:_00D1U1174p._5001UKMAt3:ref

Google Ads API Forum Advisor Prod

unread,
Oct 7, 2019, 1:57:00 PM10/7/19
to adwor...@googlegroups.com
Hello, 

Thank you for sharing all the details to troubleshoot the issue. Regret the delay as I was checking this internally with the team. Could you please check the status of the ad group criteria that you are trying to remove? We suspect that this criteria is already removed and hence you are receiving this error. If the criteria exists in the account, could you please share the screenshot of the Google Ads UI along with the ad_group_criterion resource logs, to check this further? You can share the details privately via Reply privately to author options. 

Regards,

Linas Medžiūnas

unread,
Oct 8, 2019, 9:06:57 AM10/8/19
to AdWords API and Google Ads API Forum
Hello,

apparently, soft delete is being used for ad_group_criterion resource, and the query that I posted returns already removed criteria.
I have found a way to avoid the issue by adding a WHERE condition to my query: ad_group_criterion.status != 'REMOVED'
I believe we can consider this closed (unless something new emerges).

Regards,
Linas
Reply all
Reply to author
Forward
0 new messages