Get ad_group_ad image_url of ad type: GMAIL_AD, LEGACY_RESPONSIVE_DISPLAY_AD, RESPONSIVE_DISPLAY_AD, RESPONSIVE_SEARCH_AD

556 views
Skip to first unread message

Project YSS

unread,
Dec 11, 2019, 2:13:34 AM12/11/19
to AdWords API and Google Ads API Forum
Hi,

Could i get ad_group_ad.ad.image_ad.image_url field of ad_group_ad.ad.type = GMAIL_AD, LEGACY_RESPONSIVE_DISPLAY_AD, RESPONSIVE_DISPLAY_AD or RESPONSIVE_SEARCH_AD with google-ads API?

I have tried but response always returns empty.

Thanks.

Google Ads API Forum Advisor Prod

unread,
Dec 11, 2019, 2:13:00 PM12/11/19
to ad...@septeni-technology.jp, adwor...@googlegroups.com

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.

Regards,
Anthony
Google Ads API Team


ref:_00D1U1174p._5001UOEI65:ref

Project YSS

unread,
Dec 16, 2019, 10:05:48 PM12/16/19
to AdWords API and Google Ads API Forum
I could get image data name. It relates to media_file.resource_name field of media_file resource. Right? 
But Can i get media data (Maybe binary data of file or URL to download them) if i have media_file.resource_name?

Google Ads API Forum Advisor Prod

unread,
Dec 17, 2019, 3:11:32 PM12/17/19
to ad...@septeni-technology.jp, adwor...@googlegroups.com

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



ref:_00D1U1174p._5001UOEI65:ref

Project YSS

unread,
Dec 17, 2019, 9:58:35 PM12/17/19
to AdWords API and Google Ads API Forum
Hi Bryan and Anthony,

Thanks for your suggestion.

I requested to media_file resource. 
How can i download media file with source_url like that?

Thanks.

Google Ads API Forum Advisor Prod

unread,
Dec 18, 2019, 2:54:29 PM12/18/19
to ad...@septeni-technology.jp, adwor...@googlegroups.com

Hi,

Thank you for the information. I’m checking this issue internally with my team and I will update you soon.

Google Ads API Forum Advisor Prod

unread,
Dec 19, 2019, 12:12:24 PM12/19/19
to ad...@septeni-technology.jp, adwor...@googlegroups.com
Greetings!

It's nice to virtually meet you. My teammate sent this to me because this is a tricky issue.

In the AdWords API, you were able to get a URL where you can download images if you do a query with Image.urls. I tried this with your account, and that works. The sourceUrl you were looking at before is only for your housekeeping. For example, if you also store the image locally or you got it from an external source, you can look at that field in order to figure out where you got the image.

Unfortunately, in the Google Ads API, this field is not yet available. I have increased the priority on getting this added. I do not have a timeline of when it will be available, but you can watch our release notes for a future release when we may add it. Thank you for highlighting this!

If possible, I would recommend using the AdWords API to get this information if you need to download the image that you uploaded previously.

I also took a look at all the source URLs of the media you provided. It was very helpful that you provided so much information. I can see that back in 2016 and 2017, the developers at your company  added some longer URLs for themselves. Then in 2017, the source URL was not filled in, which is why you see it empty. Recently, it looks like you are adding the name of the file. The source URL is not required, and developers use it to remember where they got the image. It's not where the image is stored at Google.

I hope that helps clarify things. Thanks again for all the details!

Best,
Nadine Wang, Google Ads API Team

ref:_00D1U1174p._5001UOEI65:ref

Project YSS

unread,
Dec 25, 2019, 4:38:14 AM12/25/19
to AdWords API and Google Ads API Forum

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.

Google Ads API Forum Advisor Prod

unread,
Dec 26, 2019, 3:21:33 AM12/26/19
to ad...@septeni-technology.jp, adwor...@googlegroups.com

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


     



ref:_00D1U1174p._5001UOEI65:ref
MediaService.java
Reply all
Reply to author
Forward
0 new messages