How to download ResponsiveDisplayAds Images

42 views
Skip to first unread message

Steven Horvat

unread,
Jan 9, 2019, 10:37:03 AM1/9/19
to AdWords API and Google Ads API Forum
I'm setting up functionality to allow us to copy ResponsiveDisplayAds and MultiAssetResponsiveDisplayAds across accounts. I realize I basically need to pull all the information out of the ads and create new ones in my destination adGroup. For downloading all the images (

marketingImage(s)squareMarketingImage(s), etc) whats the recommended way to go about that? Should I be trying to download from the image URL, or is there a way to get the image data directly?


I tried to get the image data from the adGroupAdService selection I used for all the other Ad Fields, but I'm getting NULL.
$marketing_image_data = $adGroupAd->getAd()->getMarketingImage()->getData();


 

 


Bharani Cherukuri (AdWords API Team)

unread,
Jan 9, 2019, 5:37:24 PM1/9/19
to AdWords API and Google Ads API Forum
Hello Steven, 

You may use the AssetService.get() which will return all the image assets. You will be able to filter this based on the AssetId. You may refer to the GetAllImageAssets PHP code sample as a reference. Let me know if you have any other questions. 

Regards,
Bharani, AdWords API Team

Steven Horvat

unread,
Jan 10, 2019, 10:32:24 AM1/10/19
to AdWords API and Google Ads API Forum
How do I get the AssetId from the MarketingImage? I can get mediaId from the MarketingImage, but I don't see where I'd get an AssetId to search.

Bharani Cherukuri (AdWords API Team)

unread,
Jan 10, 2019, 5:28:01 PM1/10/19
to AdWords API and Google Ads API Forum
Hello Steven, 

The MediaId will be the assetId for the image asset. You may refer to the GetAllImageAssets PHP code sample as a reference. Let me know if you have any other questions. 
Reply all
Reply to author
Forward
0 new messages