Image media urls in google ads api

726 views
Skip to first unread message

Alex Mmz

unread,
Apr 4, 2019, 7:13:24 AM4/4/19
to AdWords API and Google Ads API Forum
Hello, I was wondering how to construct/get an image MediaFile's url(s) in google ads api.

The Adwords Api provides a collection property of urls but the google ads' MediaImage via the MediaService.get() doesn't (it is also not selectable by the search api). Is this something that will be added in the future or there's another way?

Thanks,
Alex

googleadsapi...@google.com

unread,
Apr 4, 2019, 3:41:06 PM4/4/19
to AdWords API and Google Ads API Forum
Hello Alex, 

You will be able to use the Media Field to pull the details specific to the asset. If you're looking to get the Ad specific attributes, you may use the ImageAdInfo which will return the ad assets. If you're looking for any specific data, please let me know so I can check this further.

Thanks,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Alex Mmz

unread,
Apr 5, 2019, 6:47:01 AM4/5/19
to AdWords API and Google Ads API Forum
Thanks for your reply. Specifically, I'm interested about the image MediaFile resource names of the legacy responsive ad, not the image ad (e.g.  ad_group_ad.ad.legacy_responsive_display_ad.logo_image and ad_group_ad.ad.legacy_responsive_display_ad.marketing_image). I'm looking for a way to get these images' urls in order to diplay them.

From the Media field, the media_file.source_url seems to be the field I'm looking for but it's not; or at least it can't be used as a direct link to the image itself.

Thanks,
Alex

googleadsapi...@google.com

unread,
Apr 5, 2019, 1:48:08 PM4/5/19
to AdWords API and Google Ads API Forum
Hello Alex, 

The LegacyResponsiveDisplayAdInfo will include the marketing_image which is the MediaFile resource name. You can then use the media_file resource to pull the source_url. This is the only option available to get these details. 

Thanks,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Reply all
Reply to author
Forward
0 new messages