MediaId to AssetId for HTML5 ad

96 views
Skip to first unread message

Qiren Zhang

unread,
May 19, 2025, 4:15:13 AM5/19/25
to Google Ads API and AdWords API Forum
Hi Google Ads team,
when i try to get html5 ad and the html5 zip file:
1) query html5 zip file using MimeType= Html5AdZip and get something like ResourceName: customers/123/mediaFiles/456
2) query the ad and select the column ad_group_ad.ad.display_upload_ad.media_bundle, get something like customers/123/mediaFiles/789
how do i link the asset id with media id, clearly these two ids are different?

Google Ads API Forum Advisor

unread,
May 19, 2025, 7:46:55 AM5/19/25
to qirenz...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team. 

Can you confirm whether you have uploaded HTML5 ads and are trying to retrieve them using the Google Ads API? If yes, I would recommend you to refer to this documentation for more detailed information. Can you provide more clarity on your question 'how do i link the asset id with media id, clearly these two ids are different' to further assist you better. Also, can you provide your GAQL queries on how you are trying to retrieve the html5 ad and the html5 zip file from the Google Ads API? 

In order to investigate your issue further, kindly provide us with the complete API logs (request and response logs with request-id and request header) generated at your end and uncropped UI screenshot of the Google Ads account (with visible customer ID) by highlighting of what you are trying to retrieve via the API. 

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.
 

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-05-19 11:46:13Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01qXQDs:ref" (ADR-00306841)



kiyo C

unread,
May 20, 2025, 12:37:28 AM5/20/25
to Google Ads API and AdWords API Forum
Hi, thanks for replying.
So my question is not related some specific API requests. What I am asking is that, from this query

1) query html5 zip file using condition: MimeType= Html5AdZip, and get something like ResourceName: customers/123/mediaFiles/456 (media id)
2) query the ad and select the column ad_group_ad.ad.display_upload_ad.media_bundle, get something like customers/123/mediaFiles/789 (asset id)
 
in the ad query, I can get html5 ad and an asset id 789 linking to the html5 zip file, but in the asset query, try to get the html5 zip file itself, i only get the media id 456. obviously 789 and 456 mean two different ids,  so i don't know the ad is which asset/media, i need the association to get the html5 zip file for an ad.

Thanks.

Google Ads API and AdWords API Forum

unread,
May 21, 2025, 2:40:18 AM5/21/25
to Google Ads API and AdWords API Forum
Hi,

Could you please provide us with the uncropped UI screenshot with a visible customer Id by highlighting the asset Id that you are trying to retrieve using Google Ads API. Also, as requested earlier can you provide your GAQL queries on how you are trying to retrieve the html5 ad and the asset Id linked to html5 from the Google Ads API? 

You can send the details via Reply privately to the author option, or direct private reply to this email.

Thanks,
Google Ads API Team.

kiyo C

unread,
May 21, 2025, 10:35:29 PM5/21/25
to Google Ads API and AdWords API Forum
GAQL for html5 ad: 
SELECT ad_group_ad.ad.display_upload_ad.display_upload_product_type, ad_group_ad.ad.display_upload_ad.media_bundle
FROM ad_group_ad;

GAQL for html5 zip file: 
SELECT media_file.mime_type, media_file.resource_name, media_file.media_bundle.url, media_file.id
FROM media_file

from "ad_group_ad.ad.display_upload_ad.media_bundle", I can tell the html5 ad is using which html5 zip file by asset id.
from "media_file.resource_name", I can tell the media id of html5 zip file.
So I know media and asset id, but I do not know the relationship, and it causes not knowing the association between html5 ad and its zip file.
Sorry I cannot provide any UI screenshot because policy issue, but I am sure this is a general question for any account that has html5 ad.

Google Ads API Forum Advisor

unread,
May 22, 2025, 3:02:16 AM5/22/25
to qirenz...@gmail.com, adwor...@googlegroups.com

Hi,

Please note that without the customer ID, we cannot assist you further, so please provide the Customer ID and the asset ID which you are trying to link with the media ID.

Also, provide us with the complete API logs (request and response logs with request-id and request header) generated at your end.

You can send the details via Reply privately to the author option, or direct private reply to this email.

 

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-05-22 07:01:03Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01qXQDs:ref" (ADR-00306841)



Reply all
Reply to author
Forward
0 new messages