Closed 0x1881 closed 1 year ago
Are you sure that your resource name is correct?
$adGroupCriterion->setResourceName($adGroupResourceName);
It looks like you set the resource name of ad group to ad group criterion.
Are you sure that your resource name is correct?
$adGroupCriterion->setResourceName($adGroupResourceName);
It looks like you set the resource name of ad group to ad group criterion.
Thank you dude. You can close the problem.
I realized that unknown gender is not included in the target criteria. When I added the unknown gender manually, the update problem was solved.
So how can I delete and add unknown gender in ad groups with PHP?
This is an example of how to remove objects in Google Ads API. Once you remove the old one, you can then add a new one by specifying a correct resource name you want to add like shown in this example.
When I try to change the unknown gender criteria in ad groups, I get an error regarding the criteria ID. While it works flawlessly in some ad groups, it does not work in others. Please help me understand what the problem is.
Code:
Error result:
ApiException was thrown with message
{ "message": "Request contains an invalid argument.", "code": 3, "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com\/google.ads.googleads.v14.errors.GoogleAdsFailure", "errors": [ { "errorCode": { "mutateError": "RESOURCE_NOT_FOUND" }, "message": "Resource was not found.", "trigger": { "int64Value": "20" }, "location": { "fieldPathElements": [ { "fieldName": "operations", "index": 0 }, { "fieldName": "update" }, { "fieldName": "resource_name" } ] } } ], "requestId": "K9KiFCMtsD50Yf5eQOYUNA" } ] }