Error When Creating Ad Group Criterion with Language or Location

25 views
Skip to first unread message

Jimmy_00

unread,
Sep 23, 2024, 1:41:15 AM9/23/24
to Google Ads API and AdWords API Forum
I encounter an error whenever I attempt to create an ad group criterion that includes either Language or Location parameters.

You can find the detailed logs here:

Request
-------

Method Name: /google.ads.googleads.v17.services.AdGroupCriterionService/MutateAdGroupCriteria
Host: 
Headers: {
  "x-goog-api-client": "gl-dotnet/8.0.0 gapic/21.0.0 gax/4.8.0 grpc/2.60.0 gccl/4.0.1 pb/3.25.0",
  "developer-token": "REDACTED",
  "x-goog-request-params": "customer_id=1424775433"
}

{ "customerId": "1424775433", "operations": [ { "create": { "adGroup": "customers/1424775433/adGroups/170233143320", "negative": false, "location": { "geoTargetConstant": "geoTargetConstants/1023191" } } } ] }

Response
--------
Headers: {
  "request-id": "8m5jNg5MjPkvZ5aElkP-fw",
  "date": "Sun, 22 Sep 2024 10:28:38 GMT",
  "alt-svc": "h3-29=\":443\"; ma=2592000",
  "google.ads.googleads.v17.errors.googleadsfailure-bin": "Cn0KA+ADAhIzVGhlIG9wZXJhdGlvbiBpcyBub3QgYWxsb3dlZCBmb3IgdGhlIGdpdmVuIGNvbnRleHQuGhkqF1NFQVJDSChTRUFSQ0hfU1RBTkRBUkQpIiYSDgoKb3BlcmF0aW9ucxgAEggKBmNyZWF0ZRIKCghsb2NhdGlvbhIWOG01ak5nNU1qUGt2WjVhRWxrUC1mdw==",
  "grpc-status-details-bin": "CAMSJVJlcXVlc3QgY29udGFpbnMgYW4gaW52YWxpZCBhcmd1bWVudC4a4AEKRHR5cGUuZ29vZ2xlYXBpcy5jb20vZ29vZ2xlLmFkcy5nb29nbGVhZHMudjE3LmVycm9ycy5Hb29nbGVBZHNGYWlsdXJlEpcBCn0KA+ADAhIzVGhlIG9wZXJhdGlvbiBpcyBub3QgYWxsb3dlZCBmb3IgdGhlIGdpdmVuIGNvbnRleHQuGhkqF1NFQVJDSChTRUFSQ0hfU1RBTkRBUkQpIiYSDgoKb3BlcmF0aW9ucxgAEggKBmNyZWF0ZRIKCghsb2NhdGlvbhIWOG01ak5nNU1qUGt2WjVhRWxrUC1mdw=="
}

Fault: {
  "StatusCode": 3,
  "Details": "Request contains an invalid argument.",
  "RequestId": "8m5jNg5MjPkvZ5aElkP-fw",
  "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": "location"
            }
          ]
        }
      }
    ],
    "requestId": "8m5jNg5MjPkvZ5aElkP-fw"
  }
}
----------------END API CALL----------------

Google Ads API Forum Advisor

unread,
Sep 23, 2024, 7:50:04 AM9/23/24
to jamal.al...@gmail.com, adwor...@googlegroups.com
Hi,

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

I understand that you've encountered the "OPERATION_NOT_PERMITTED_FOR_CONTEXT" error while trying to include language or location parameters in ad group criteria. Please note that the language and location targeting is not supported at ad group level. I would suggest you check the ad group criteria document.

The location and language targeting or exclusion is only supported at campaign level. You may refer to this campaign criteria document for more information. 

I hope this clarifies. 
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGUo3:ref" (ADR-00269106)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages