Skip to content

Unable to update ad_group.targeting_setting.target_restrictions #62

@pswanston

Description

@pswanston

Hey Ben,

I'm not even sure if this is supposed to be possible but I'm having trouble updating ad_group.targeting_setting.target_restrictions it appears to throw a server side error saying the field is immutable. Do you know if this is an error, functionality that is yet to be implemented, or soon to be no longer supported?

I did look in the documentation https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v1.common#google.ads.googleads.v1.common.TargetingSetting
On other fields that are non mutable there is a note that says something like "This field is required for CREATE operations and is prohibited on UPDATE operations."
This note is not on TargetingSetting, and historically these values were mutable on the AdWords API. So I'm not entirely sure whats going on.

Below is the API log incase I'm making some mistake and you have some suggestions. Thanks!

Peter

Request
-------
Method: /google.ads.googleads.v1.services.AdGroupService/MutateAdGroups
Host: googleads.googleapis.com:443
Headers: {
  "developer-token": "REDACTED",
  "login-customer-id": "6715128853",
  "x-goog-api-client": "gl-python/2.7.12 grpc/1.14.2 gax/1.4.1 gapic/1.1.1"
}
Request: {
  "operations": [
    {
      "update": {
        "resourceName": "customers/6715128853/adGroups/69225813358",
        "targetingSetting": {
          "targetRestrictions": [
            {
              "bidOnly": true,
              "targetingDimension": "AUDIENCE"
            }
          ]
        }
      },
      "updateMask": "resourceName,targetingSetting.targetRestrictions"
    }
  ],
  "partialFailure": true,
  "customerId": "6715128853"
}
Response
-------
Headers: {
  "content-disposition": "attachment",
  "request-id": "WmQbbceJWjM_JLvM7LhFOA"
}
Response: {
  "partialFailureError": {
    "message": "Field 'targeting_setting.target_restrictions' cannot be modified by 'UPDATE' operation., at operations[0].update.targeting_setting.target_restrictions",
    "code": 3,
    "details": [
      {
        "@type": "type.googleapis.com/google.ads.googleads.v1.errors.GoogleAdsFailure",
        "errors": [
          {
            "errorCode": {
              "requestError": "IMMUTABLE_FIELD"
            },
            "message": "Field 'targeting_setting.target_restrictions' cannot be modified by 'UPDATE' operation.",
            "location": {
              "fieldPathElements": [
                {
                  "index": "0",
                  "fieldName": "operations"
                },
                {
                  "fieldName": "update"
                },
                {
                  "fieldName": "targeting_setting"
                },
                {
                  "fieldName": "target_restrictions"
                }
              ]
            }
          }
        ]
      }
    ]
  },
  "results": [
    {}
  ]
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions