How to get asset information for HTML5_UPLOAD_AD

203 views
Skip to first unread message

Dihan Cheng

unread,
Nov 13, 2020, 10:41:12 AM11/13/20
to AdWords API and Google Ads API Forum
Hello,

I pull HTML5_UPLOAD_AD using google ads api v5, and ad_data has a mediaAsset field which contains the resource_name of the asset, example as below. How can I get the actual asset information from the resource name? I get all assets for the customer by querying the asset entity, however the result doesn't contain any of the html5 resources.

so my question is how do I get the asset data from the resource "customers/4425978192/assets/11413923409"

{"mediaAssetCase_":2,"mediaAsset_":{"bitField0_":1,"asset_":"customers/4425978192/assets/11413923409","memoizedIsInitialized":-1,"unknownFields":{"fields":{},"fieldsDescending":{}},"memoizedSize":-1,"memoizedHashCode":0},"displayUploadProductType_":2,"memoizedIsInitialized":-1,"unknownFields":{"fields":{},"fieldsDescending":{}},"memoizedSize":-1,"memoizedHashCode":0}

thanks,

Dihan

Google Ads API Forum Advisor Prod

unread,
Nov 16, 2020, 3:19:58 AM11/16/20
to dch...@newengen.com, adwor...@googlegroups.com
Hi Dihan,

Could you confirm how you are currently extracting the asset information? So I can better understand, could you provide your customer ID and the complete request and response logs? You may send the requested details using the Reply privately to author option.

Also, generally, your assets information can be retrieved using the AssetService.GetAssetRequest. As for retrieving other information such as its metrics, you may refer to this guide as well.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q27tfEX:ref
Message has been deleted

Google Ads API Forum Advisor Prod

unread,
Dec 7, 2020, 3:09:32 AM12/7/20
to dch...@newengen.com, adwor...@googlegroups.com
Hi Dihan,

I had to delete your recent post as it contained your account information. Edited and re-posting below for reference :

"Below is the query I use to extract the asset information, 

SearchGoogleAdsStreamRequest searchGoogleAdsStreamRequest =
SearchGoogleAdsStreamRequest.newBuilder()
.setCustomerId(customerId)
.setQuery(
"SELECT asset.id, asset.image_asset.file_size, asset.image_asset.full_size.height_pixels, "
+ "asset.image_asset.full_size.url, asset.image_asset.full_size.width_pixels, "
+ "asset.image_asset.mime_type, asset.name, asset.type, asset.text_asset.text, "
+ "asset.youtube_video_asset.youtube_video_id, asset.resource_name "
+ "FROM asset "
+ "WHERE asset.type IN ('IMAGE', 'YOUTUBE_VIDEO', 'MEDIA_BUNDLE')")
.build();

For HTML5_UPLOAD_AD, my understanding is the asset is MEDIA_BUNDLE type, however, the result from above query doesn't have anything inside MEDIA_BUNDLE.

Client id is XXXXXXXXX

thanks,

Dihan
"

Moving forward, could you please share the complete request and response logs? You may send the logs using the Reply privately to author option.

Dihan Cheng

unread,
Dec 7, 2020, 11:03:56 AM12/7/20
to AdWords API and Google Ads API Forum
I can't find where is "Reply privately to author" option

Dihan Cheng

unread,
Dec 7, 2020, 11:04:56 AM12/7/20
to AdWords API and Google Ads API Forum
There is a "reply to author" option, but it says "You do not have permission to reply to author in this group"

Google Ads API Forum Advisor Prod

unread,
Dec 8, 2020, 2:54:35 PM12/8/20
to dch...@newengen.com, adwor...@googlegroups.com
Hello,

If you are unable to reply privately, can you please send an email to googleadsa...@google.com and include a link to this discussion in your email?

Thanks,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q27tfEX:ref

Dihan Cheng

unread,
Feb 3, 2021, 12:09:59 PM2/3/21
to AdWords API and Google Ads API Forum
Hi Support, is there any progress on this issue?

I sent the email privately not sure if you received it, the customer id is 4425978192. this customer has HTML5_UPLOAD_AD , but I'm not able to get the asset information.

thanks,

Dihan

Google Ads API Forum Advisor Prod

unread,
Feb 4, 2021, 11:01:50 AM2/4/21
to dch...@newengen.com, adwor...@googlegroups.com
Hi Dihan,

Yes, we received your private message. We requested for the following details:
However, could you provide the screenshot of the HTML5 assets in the UI that you are trying to retrieve using asset report that I was requested previously?

Also provide the complete request and response logs with request ID generated on your end. If you haven't enabled the logging of the API transactions of the client library, then please refer to the specific guide below:
 
Please provide the details on that thread so that we can further investigate.

Regards,
Anthony
Google Logo
Anthony
Google Ads API Team
 


ref:_00D1U1174p._5004Q27tfEX:ref

Dihan Cheng

unread,
Feb 6, 2021, 6:23:47 PM2/6/21
to AdWords API and Google Ads API Forum
The customer id is 4425978192

The complete query to retrieve the media assets is

SELECT asset.id, asset.image_asset.file_size, asset.image_asset.full_size.height_pixels, 
asset.image_asset.full_size.url, asset.image_asset.full_size.width_pixels, 
asset.image_asset.mime_type, asset.name, asset.type, asset.text_asset.text, 
asset.youtube_video_asset.youtube_video_id, asset.resource_name "
FROM asset 
WHERE asset.type IN ('IMAGE', 'YOUTUBE_VIDEO', 'MEDIA_BUNDLE');

The response of above query is

{

customers/4425978192/assets/12386056635=resource_name: "customers/4425978192/assets/12386056635"

type: MEDIA_BUNDLE

id: 12386056635

name: ""

, customers/4425978192/assets/12600819774=resource_name: "customers/4425978192/assets/12600819774"

type: MEDIA_BUNDLE

id: 12600819774

name: ""

, customers/4425978192/assets/9165172279=resource_name: "customers/4425978192/assets/9165172279"

type: IMAGE

image_asset {

  mime_type: IMAGE_PNG

  full_size {

    height_pixels: 4095

    width_pixels: 4095

    url: "https://tpc.googlesyndication.com/simgad/6697864840109146719"

  }

  file_size: 550026

}

id: 9165172279

name: "CP_FinalBrandMark.png"

, customers/4425978192/assets/9181350339=resource_name: "customers/4425978192/assets/9181350339"

type: IMAGE

....

}

So for MEDIA_BUNDLE type of assets, we don't have any asset information except for id and resource_name,

thanks,

Dihan

---

Google Ads API Forum Advisor Prod

unread,
Feb 7, 2021, 9:39:55 PM2/7/21
to dch...@newengen.com, adwor...@googlegroups.com
Hi Dihan,

Thank you for sharing these details.

The details of your MediaBundleAsset (zipped) would not be available through the reports or via this query. Also the said (data) field is mutate only and may not be possible to retrieve via a get operation.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q27tfEX:ref

Dihan Cheng

unread,
Feb 8, 2021, 4:33:52 PM2/8/21
to AdWords API and Google Ads API Forum
then how should I supposed to get asset info for HTML5 type of ads?

Google Ads API Forum Advisor Prod

unread,
Feb 9, 2021, 9:26:54 PM2/9/21
to dch...@newengen.com, adwor...@googlegroups.com
Hi Dihan,

Upon checking also the html5_media_bundles, only the resource name of its asset is available. With this, allow me to create a feature request related to your inquiry.

Please note that this will be subject for review. For now, you may keep an eye on our blog for updates.

Google Ads API Forum Advisor Prod

unread,
Feb 10, 2021, 6:47:30 AM2/10/21
to dch...@newengen.com, adwor...@googlegroups.com

Hi Dihan,

Could you try adding asset.media_bundle_asset.data to your query? This is supported in Google Ads API v6, see https://developers.google.com/google-ads/api/reference/rpc/v6/Asset#media_bundle_asset for details.
 

Cheers
Anash



ref:_00D1U1174p._5004Q27tfEX:ref

Dihan Cheng

unread,
Feb 10, 2021, 4:36:59 PM2/10/21
to AdWords API and Google Ads API Forum
Got the following error when adding asset.media_bundle_asset.data to the query;

  message: "The following field may not be used in SELECT clause: \'asset.media_bundle_asset.data\'."

looks this field is not mutable, not selectable


Google Ads API Forum Advisor Prod

unread,
Feb 11, 2021, 6:12:37 PM2/11/21
to dch...@newengen.com, adwor...@googlegroups.com
Hi Dihan,

Could you share an API call log for the failing request by using the "Reply to user" option? To enable logging for your client library, look for the Logging guide under the respective client library on this page: https://developers.google.com/google-ads/api/docs/client-libs

Dihan Cheng

unread,
Feb 12, 2021, 10:46:59 AM2/12/21
to AdWords API and Google Ads API Forum
The "Reply to author" option is disabled, so I can only reply to all, 

below is the query I submitted,

SELECT asset.id, asset.image_asset.file_size, asset.image_asset.full_size.height_pixels, 
asset.image_asset.full_size.url, asset.image_asset.full_size.width_pixels, 
asset.image_asset.mime_type, asset.name, asset.type, asset.text_asset.text, 
asset.youtube_video_asset.youtube_video_id, asset.resource_name, asset.media_bundle_asset.data

FROM asset 
WHERE asset.type IN ('IMAGE', 'YOUTUBE_VIDEO', 'MEDIA_BUNDLE');

Google Ads API Forum Advisor Prod

unread,
Feb 19, 2021, 3:32:11 PM2/19/21
to dch...@newengen.com, adwor...@googlegroups.com
Hi Dihan,

I've reached out the engineering team, this may not be supported in the API right now.
Reply all
Reply to author
Forward
0 new messages