How to get Image Urls/Text for Responsive Display Ads

128 views
Skip to first unread message

MATTHEW Dworkin

unread,
Jun 21, 2022, 2:48:41 PM6/21/22
to Google Ads API and AdWords API Forum
Hello,

I'm trying to pull a report for Ads, and I'm having difficulty getting URLs and text for image and headline assets. I'm able to get the resource names for them, but have been unable to pull actual image urls and the actual headlines. 

I've tried a few of approaches and have been scouring the php library but can't seem to find what I need. 

1. $googleAdsRow->getAdGroupAd()->getAd()->getImageAd() - Returns null
1.a. getImageAd is supposed to return an ImageAdInfo object that has a getImageUrl method on it, but sincee ImageAdInfo is null, I cant' use it.
2. $googleAdsRow->getAdGroupAd()->getAd()->getResponsiveDisplayAd() returns iterator 
2.a Iterate over return from 2 and use getAsset(), returns resource name

I've faced similar issues w/ text ads.

So a few questions:
i. Is what I'm trying to do possible? (seems like it should be)
ii. What do I need to do?

Thanks for your help!

Best,
Matt

Google Ads API Forum Advisor

unread,
Jun 21, 2022, 11:17:26 PM6/21/22
to mdwor...@gmail.com, adwor...@googlegroups.com
Hi Matt,

Thank you for posting your concern.

On the GAQL of the Google Ads API, you can use the ad_group_ad and include the image related fields and text related fields below that mentioned on this document to get the information that you are looking for:

Text fields:
ad_group_ad.ad.responsive_display_ad.headlines
ad_group_ad.ad.responsive_display_ad.long_headline
ad_group_ad.ad.responsive_display_ad.promo_text

Image fields:
ad_group_ad.ad.responsive_display_ad.logo_images
ad_group_ad.ad.responsive_display_ad.logo_images.asset
ad_group_ad.ad.responsive_display_ad.marketing_images
ad_group_ad.ad.responsive_display_ad.marketing_images.asset
ad_group_ad.ad.responsive_display_ad.square_logo_images
ad_group_ad.ad.responsive_display_ad.square_logo_images.asset
ad_group_ad.ad.responsive_display_ad.square_marketing_images
ad_group_ad.ad.responsive_display_ad.square_marketing_images.asset

However, since it appears that you are having a problem on what code objects to use to get the information that you are looking for, then I am afraid that I would not be able to provide support here. The reason is, code / client library related concerns are outside of our scope already. With this, I would suggest reaching out to the author of the PHP client library to get insights for your concern/questions as they are more equipped to this matter.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2byk3I:ref
Reply all
Reply to author
Forward
0 new messages