Update ExpandedText Ads

41 views
Skip to first unread message

Irfan Rafiq

unread,
Nov 24, 2019, 3:57:58 PM11/24/19
to AdWords API and Google Ads API Forum
Hi,

I am using Google Ads Api v2, and Java Client Library 4.2.0

I would like to update an existing Expanded Text Ad. I tried using method google.ads.googleads.v2.services.AdGroupAdService/MutateAdGroupAds however I am getting errors such as:   request_error: IMMUTABLE_FIELD

However after a bit of digging I believe I have been using the incorrect service, instead I am using method google.ads.googleads.v2.services.AdService/MutateAds

Am I correct in using this method as opposed to the MutateAdGroupAds?


Secondly I could not find an applicable method to generate the resource name in class ResourceNames. In the end I just created a string i.e. 

    String adGroupAdResourceName = "customers/{customer_id}/ads/{ad_id}";

Which seemed to do the trick. I was wondering if there is a ResourceName method I should be using which I am not aware off? Or if not could this be added in the next release.

Many Thanks
Irfan

Google Ads API Forum Advisor Prod

unread,
Nov 25, 2019, 10:16:26 AM11/25/19
to adwor...@googlegroups.com

Hi Irfan,

Thanks for reaching out. The following are the answers to your questions:

1. You need to use AdService/MutateAds instead of AdGroupAdService/MutateAdGroupAds when you update existing ad.

2. Currently there is no specific method to create the ResourceName. However, you could create it on your own or request ad_group_ad.resource_name from the ad_group_ad resource.

Please let us know if you have any further questions.

Thanks and regards,
Xiaoming, Google Ads API Team



ref:_00D1U1174p._5001UODABp:ref

Irfan Rafiq

unread,
Nov 25, 2019, 11:17:54 AM11/25/19
to AdWords API and Google Ads API Forum
Perfect. Thanks for the speedy response!
Reply all
Reply to author
Forward
0 new messages