OPERATION_NOT_PERMITTED_FOR_CONTEXT when adding language as AdGroupCriterion

44 views
Skip to first unread message

LP AI

unread,
Sep 24, 2024, 11:44:28 AM9/24/24
to Google Ads API and AdWords API Forum
I am trying to add a language as an AdGroupCriterion to an Adgroup but have an error. I am trying to add the Spanish language to it and this is my request.

``` google-ads.NOTICE: Request
-------
Method Name: /google.ads.googleads.v17.services.AdGroupCriterionService/MutateAdGroupCriteria
Host: googleads.googleapis.com
Headers: {
    "x-goog-api-client": "gl-php\/8.2.22 gccl\/24.0.0 gapic\/24.0.0 gax\/1.27.0 grpc\/1.64.1 rest\/1.27.0 pb\/4.27.1+c",
    "User-Agent": "gcloud-php-new\/24.0.0",
    "x-goog-request-params": "customer_id=3887069481",
    "developer-token": "REDACTED",
    "login-customer-id": "8635405232"
}
Request:
{"customerId":"3887069481","operations":[{"create":{"adGroup":"customers/3887069481/adGroups/162239936307","language":{"languageConstant":"languageConstants/1003"}}}]}

Response
-------
Headers: {
    "request-id": "7dPVmbWoFfeCzqJ2FOjRow",
    "date": "Tue, 24 Sep 2024 12:51:26 GMT",
    "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
}

Fault
-------
Status code: 3
Details: Request contains an invalid argument.
Failure: {"errors":[{"errorCode":{"contextError":"OPERATION_NOT_PERMITTED_FOR_CONTEXT"},"message":"The operation is not allowed for the given context.","trigger":{"stringValue":"SEARCH(SEARCH_STANDARD)"},"location":{"fieldPathElements":[{"fieldName":"operations","index":0},{"fieldName":"create"},{"fieldName":"language"}]}}],"requestId":"7dPVmbWoFfeCzqJ2FOjRow"}```

Google Ads API Forum Advisor

unread,
Sep 25, 2024, 12:53:46 AM9/25/24
to le...@autographicinsight.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

From the provided logs, I understand that you've encountered the "OPERATION_NOT_PERMITTED_FOR_CONTEXT" error while trying to target the language in ad group criteria. Please note that the language targeting is not supported at ad group level. I would suggest you check the ad group criteria document.

The language targeting or exclusion is only supported at campaign level. You may refer to this campaign criteria document for more information. 
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGYPg:ref" (ADR-00269362)

Thanks,
 
Google Logo Google Ads API Team


LP AI

unread,
Sep 25, 2024, 4:12:43 AM9/25/24
to Google Ads API and AdWords API Forum
This doesn't match with another reply I hae received. I am creating a keyword in an account and it gets an error related to the language as the system detects it as a different language and so does not approve the ad. This is what I was told

It seems that the mechanism we use to determine the language for a given ad group is via a specific criterion. Since the ad group in question here doesn't have a language criterion, we can't determine which language the keywords are using, hence the error. I believe you can remedy this by creating a new language criterion in the ad group with the language you want to use for the keywords.

Those are the links I was given and those documents do include details of using the language criterion. This does not seem to be related to targeting so should this be possible?

Google Ads API Forum Advisor

unread,
Sep 25, 2024, 9:23:42 AM9/25/24
to le...@autographicinsight.com, adwor...@googlegroups.com
Hi,

As previously mentioned, the API documentation lacks ad group criteria for language. Therefore, I request that you create campaign criteria that include language settings to prevent errors.
Reply all
Reply to author
Forward
0 new messages