Hi,
Thanks for reaching out to us. Unfortunately, you cannot get the ad_group_ad.ad.image_ad.image_url field of the ad.types you listed because this query is for ads with the “image_ad” type. An image_ad type is it’s own ad type and is different from gmail_ad, legacy_responsive_display_ad, responsive_display_ad and responsive_search_ad.
While you are unable to get image_url data for the ad.types you have listed, here are some things you can query:
For gmail_ad types, you can use ad_group_ad.ad.gmail_ad.header_image, ad_group_ad.ad.gmail_ad.marketing_image, or ad_group_ad.ad.gmail_ad.product_images to get image name data. Please see here for query choices.
For legacy_responsive_display_ads, you can use ad_group_ad.ad.legacy_responsive_display_ad.marketing_image to get image name data. Please see here for query choices.
For responsive_display_ads, you can use ad_group_ad.ad.responsive_display_ad.marketing_images to get image name data. Please see here for query choices.
For responsive_search_ads, there unfortunately aren’t any image data query types. Please see here for query choices.
Please see here for the different supported ad types. Let me know if you have any more questions.
Hi,
My name is Bryan and I’m Anthony’s colleague assisting you on his behalf. Yes, if your Image data name has type resource_name, then it relates to the media_file.resource_name field. You are also able to get the source_url of the original media file using media_file.source_url, which is used for AUDIO and IMAGE media types. Please let me know if you have any more questions.
Thank you,
Bryan, Google Ads API Team
Hi,
Thank you for the information. I’m checking this issue internally with my team and I will update you soon.
Hi,
Is there another way to get raw image data through Google Ads API?
I have tried to request GetMediaFile method of Google Ads API through gRPC.
Then get MediaImage of MediaFile. But i couldn't.
I requested media file (customers/2995081632/mediaFiles/1932967848) and API return MimeType is 2. (This value means UNKNOWN?)
Only get MediaImage with MimeType is 3?
We need to get raw data on Google Ads API urgently. Thanks for your support.
Hi ,
This is Fan assisting you on Nadine's behalf as she's on vacation.
1. As Nadine mentioned, you can download media images on the AdWords API if you do a query with Media.Image.urls field. If possible, I would recommend using the AdWords API to get this information and attached is a Java code sample.
2. In the Google Ads API, this field(image url) is not yet available. We will prioritize but there is not a timeline of when it will be available. You can watch our release notes for a future release when we may add it.
Besides, if you issue an GAQL like below, a "PROHIBITED_FIELD_IN_SELECT_CLAUSE" error is returned which means reading MEDIA image data directly is not supported. a.k.a it's impossible to download media image via Google Ads API in the interim.
SELECT media_file.resource_name, media_file.type, media_file.source_url, media_file.file_size, media_file.image.data FROM media_file
3. On the Google Ads API, most ad formats have migrated to image ASSET instead of image MEDIA, e.g. the Responsive Display Ad and App Ad. Please checkout the code samples about how to upload and read image and video assets, and attach to the newly created ads.
Thanks and regards
Fan, Google Ads API Team