Thank you for your answer.
According to your answer, I tried updating the image with AdSerivce.
The code I made is below :
====================
$newImageAd = new ImageAdInfo();
$newImageAd->setData(new BytesValue(['value' =>
file_get_contents($pathTgt)]));
$updatedAd = new Ad([
'resource_name' => AdServiceClient::adName(GOOGLE_ADS_CUSTOMER_ID,
$adId),
'image_ad' => $newImageAd,
]);
$operation = new AdOperation();
$operation->setUpdate($updatedAd);
$operation->setUpdateMask(FieldMasks::allSetFieldsOf($updatedAd));
$operations[] = $operation;
$adService->mutateAds(GOOGLE_ADS_CUSTOMER_ID, $operations);
====================
However, the following error was occurred:
====================
Field 'image_ad.ad_id_to_copy_image_from' cannot be modified by 'UPDATE'
operation.
Field 'image_ad.data' cannot be modified by 'UPDATE' operation.
Field 'image_ad.media_file' cannot be modified by 'UPDATE' operation.
====================
Can't we update the image of the ImageAd ?
Or, are there any walk-around?
Best Regards.
2020年2月7日金曜日 5時30分43秒 UTC+9 adsapiforumadvisor:
>
> Hello,
>
> Thank you for writing to us. With regards to your concern, it is not
> possible to mutate ad group ads using AdGroupAdService
> <https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v2.services?hl=ru#google.ads.googleads.v2.services.AdGroupAdService>.
>
> You will need to use AdService
> <https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v2.services#adservice>
>
> for updating existing ads that were created using AdGroupAdService. Please
> modify your request to update the image ad using AdService and let me know
> if you still have any issues.
>
> Regards,
> Nikisha Patel, Google Ads API Team
>
>
> ref:_00D1U1174p._5001UV05Rt:ref
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/59901419-5f2f-4c6d-80ab-763f425f9152%40googlegroups.com.