Hi,
I am trying to remove some of the previously set Campaign Criterions, such as language.
I use the following peace of code:
public function removeCampaignCriterion(
$customerId,
$campaignId,
$criterionId
) {
$campaignCriterionResourceName = ResourceNames::forCampaignCriterion($customerId,$campaignId,$criterionId);
$campaignCriterionOperation = new CampaignCriterionOperation();
$campaignCriterionOperation->setRemove($campaignCriterionResourceName);
$campaignCriterionServiceClient = $this->googleAdsClient->getCampaignCriterionServiceClient();
$campaignCriterionServiceClient->mutateCampaignCriteria(
$customerId,
$campaignCriterionOperation
);
Unfortunately this doesn't work and I get the following message:
Fatal error: Uncaught Google\ApiCore\ApiException: { "message": "Request contains an invalid argument.", "code": 3, "status": "INVALID_ARGUMENT", "details": [ { "@type": 0, "data": "
type.googleapis.com\/google.ads.googleads.v8.errors.GoogleAdsFailure" }, { "@type": 0, "data": [ { "errorCode": { "mutateError": "RESOURCE_NOT_FOUND" }, "message": "Resource was not found.", "trigger": { "int64Value": "XXXXXXX" }, "location": { "fieldPathElements": [ { "fieldName": "operations", "index": 0 }, { "fieldName": "remove" } in
/var/www/html/Direktorijum/google-ads-php/vendor/google/gax/src/ApiException.php on line
139
I have checked and the campaign Id (XXXXXX value) is correct.
Could you please help me with this?
Thanks in advance,
Filip