IMAGE_AD Immutable or Mutable?

71 views
Skip to first unread message

Pete Lavetsky (AdWords API Guru)

unread,
Jan 12, 2022, 4:52:34 PM1/12/22
to Google Ads API and AdWords API Forum
Hi all,

This question boils down to: "Are final urls of Image Ads mutable?"

According to this documentation it says that Image Ads are mutable : https://developers.google.com/google-ads/api/docs/ads/ad-types#description_of_each_ad_type

However here it says that ImageAdInfo is immutable : https://developers.google.com/google-ads/api/reference/rpc/v9/Ad

We're not attempting to mutate the data of the Image Ad, just the Final URL of the Ad.

Here is the full request and response with some customer sensitive data removed.

The request id is : bcB1aFU7Q_KMLaQZWRXmFQ

Request
-------
MethodName: google.ads.googleads.v9.services.AdService/MutateAds
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=ABC, x-goog-api-client=gl-java/11.0.13 gccl/16.0.2 gapic/16.0.2 gax/2.5.0 grpc/1.40.1}
Body: customer_id: "XYZ"
operations {
  update {
    type: IMAGE_AD
    resource_name: "customers/ABC/ads/573016978749"
    id: 573016978749
    final_urls: "https://www.eample.com/"
  }
  update_mask {
    paths: "resource_name"
    paths: "id"
    paths: "final_urls"
    paths: "type"
  }
}


Response
--------
Headers: Metadata(content-type=application/grpc,request-id=bcB1aFU7Q_KMLaQZWRXmFQ,date=Wed, 12 Jan 2022 21:40:09 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43")
Body: null
Failure message: errors {
  error_code {
    ad_error: CANNOT_MODIFY_AD
  }
  message: "Cannot modify an ad."
  trigger {
    string_value: ""
  }
  location {
    field_path_elements {
      field_name: "operations"
      index: 0
    }
    field_path_elements {
      field_name: "update"
    }
    field_path_elements {
      field_name: "resource_name"
    }
  }
}
request_id: "bcB1aFU7Q_KMLaQZWRXmFQ"

Thanks
Pete

Google Ads API Forum Advisor

unread,
Jan 13, 2022, 3:13:35 AM1/13/22
to pete.l...@gmail.com, adwor...@googlegroups.com

Hi Pete,

Thanks for reaching out to the Google Ads API Forum.

For your question "Are final urls of Image Ads mutable?", Yes. However, ImageAdInfo is immutable. Upon checking your API request, I can see that you’re adding different attributes in update_mask. I have updated the final Urls of my Image Ad as seen below:

{

  "operations": [

     {"update": {

    'type': 'IMAGE_AD',

    'resource_name': "customers/***/ads/559983145860",

    'id': '573016978749',

    'final_urls': "https://www.update.com/"

  },

  'update_mask': {

    'paths': "final_urls"

  }

 } ],

  "partialFailure": true}

Response:

{

  "results": [

    {

      "resourceName": "customers/****/ads/****45860"

    }

  ]

}

Hope this helps. Let us know if you have any additional questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 

 



ref:_00D1U1174p._5004Q2UjSMG:ref
Message has been deleted
Message has been deleted

Google Ads API Forum Advisor

unread,
Jan 18, 2022, 6:52:06 AM1/18/22
to pete.l...@gmail.com, adwor...@googlegroups.com

Hi Pete,

Thanks for getting back to us.

Kindly note that ExpandedTextAdInfo are mutable while ImageAdInfo are immutable. Upon checking your API request for image_ad, I do see an empty image_ad { } in your second comment. However, could you retry your request by passing the resource name in image_ad { } for image_ad?  Also, could you provide us the complete request and response logs with request ID generated for RESOURCE_NAME_MISSING error, so that our team can better check? 

In addition, I had to delete your last posts as it contained your sensitive logs. Kindly send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,

Pete Lavetsky (AdWords API Guru)

unread,
Jan 18, 2022, 8:20:49 AM1/18/22
to Google Ads API and AdWords API Forum
Yasar,

You can't set resource_name on ImageAdInfo as ImageAdInfo is not a resource : https://developers.google.com/google-ads/api/reference/rpc/v9/ImageAdInfo

Here is a request, with no specific customer details, that fails when you only send in the resource_name and final_urls, with no empty image_ad

The requestId is uw7YdhxS3sdzQ48GMofxcQ

Request:

MethodName: google.ads.googleads.v9.services.AdService/MutateAds

operations {

  update {

    resource_name: "customers/ABC/ads/XYZ"

    final_urls: "https://www.update.com/"

  }

  update_mask {

    paths: "final_urls"

  }

}

Response:

Body: null

Failure message: errors {

  error_code {

    ad_error: CANNOT_MODIFY_AD

  }

  message: "Cannot modify an ad."

  trigger {

    string_value: ""

  }

  location {

    field_path_elements {

      field_name: "operations"

      index: 0

    }

    field_path_elements {

      field_name: "update"

    }

    field_path_elements {

      field_name: "resource_name"

    }

  }

}

request_id: "uw7YdhxS3sdzQ48GMofxcQ"


Status: Status{code=INVALID_ARGUMENT, description=Request contains an invalid argument., cause=null}.


I have emailed that address with customer specific details.


Pete

Reply all
Reply to author
Forward
0 new messages