Hi.
We tried updating ImageAd's image via the GoogleAdsAPI with the following
code:
```
$adGroupAd = new AdGroupAd([
'resource_name' => ResourceNames::forAdGroupAd(GOOGLE_ADS_CUSTOMER_ID,
$paramAd->getAdGroup()->getId()->getValue(),
$paramAd->getAdGroupAd()->getAd()->getId()->getValue()),
'ad' => new Ad([
'image_ad' => new ImageAdInfo([
'data' => new BytesValue(['value' =>
file_get_contents($pathTgt)]),
])
]),
]);
$operation = new AdGroupAdOperation();
$operation->setUpdate($adGroupAd);
$operation->setUpdateMask(FieldMasks::allSetFieldsOf($adGroupAd));
$operations[] = $operation;
$adGroupAdService->mutateAdGroupAds(GOOGLE_ADS_CUSTOMER_ID, $operations);
```
Howerver, it occurred the error such as:
```
Field 'ad.app_ad' cannot be modified by 'UPDATE' operation.
Field 'ad.app_engagement_ad' cannot be modified by 'UPDATE' operation.
Field 'ad.call_only_ad' cannot be modified by 'UPDATE' operation.
Field 'ad.device_preference' cannot be modified by 'UPDATE' operation.
Field 'ad.display_upload_ad' cannot be modified by 'UPDATE' operation.
Field 'ad.display_url' cannot be modified by 'UPDATE' operation.
Field 'ad.expanded_dynamic_search_ad' cannot be modified by 'UPDATE'
operation.
Field 'ad.expanded_text_ad' cannot be modified by 'UPDATE' operation.
Field 'ad.final_app_urls' cannot be modified by 'UPDATE' operation.
Field 'ad.final_mobile_urls' cannot be modified by 'UPDATE' operation.
Field 'ad.final_url_suffix' cannot be modified by 'UPDATE' operation.
Field 'ad.final_urls' cannot be modified by 'UPDATE' operation.
Field 'ad.gmail_ad' cannot be modified by 'UPDATE' operation.
Field 'ad.hotel_ad' cannot be modified by 'UPDATE' operation.
Field 'ad.image_ad.ad_id_to_copy_image_from' cannot be modified by 'UPDATE'
operation.
Field 'ad.image_ad.data' cannot be modified by 'UPDATE' operation.
…
```
So, I have some questions.
1) How do we update the ImageAd's image via the GoogleAdsAPI?
2) If we cannot, we have to update the ImageAd's image with the following
method?
a) Create the new ImageAd.
b) Remove the old ImageAd.
Best Regards.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/e8700c4d-73f2-4bcd-8681-e08c240e6a7e%40googlegroups.com.