Hello,
I was wondering if it is possible at the moment to use Google Ads API v8 in Python to download the assets (.html, .jpg, .js, etc.) in a .zip file for an HTML5 ad.
I could do it for image ads pretty straightforward, since I can get the ad_group_ad.ad.image_ad.image_url field, then retrieve the url and save as a .png. But for HTML5 ad, there would be no ad_group_ad.ad.image_ad.image_url field. I tried using the ad_group_ad.ad.display_upload_ad.media_bundle field targeting at one specific HTML5 ad within our Google Ads account, and I was able to retrieve the asset resource name in the format of "customers/(account_id)/assets/(asset_id)", then I do (in Python):
asset_service = client.get_service("AssetService", version="v8")
asset = asset_service.get_asset(resource_name={resource_name of that HTML5 ad})
print(asset)
print(asset.media_bundle_asset.data)
And I can indeed retrieve an Asset object by running the above code, but there is no data in asset.media_bundle_asset.data, which is supposed to be a 'bytes' class in Python. I was wondering if I'm on the right path of getting the asset files for an HTML5 ad this way, or if there might be another way.
In addition, I did notice that, in Google Ads platform, if I click on an HTML5 ad, I can get an ad preview link. If I open this preview link, then I get to see this HTML5 ad, and I can right click this entire web page and save as a folder of files, which is exactly what I'm looking for from downloading from Google Ads API programmatically. So I was also wondering if I could get this preview link somewhere from Google Ads API.
Thank you!