Connect media files and ads
I'm able to list ads:
https://developers.google.com/google-ads/api/fields/v5/ad_group_ad
select ad_group_ad.ad.id, ad_group_ad.ad.name from ad_group_ad
And media files:
https://developers.google.com/google-ads/api/fields/v5/media_file
select media_file.id, media_file.media_bundle.url from media_file
But I'm unable to connect the two. I tried many things:
This gives: The following field may not be used in SELECT clause: 'ad_group_ad.ad.image_ad.media_file'.
select ad_group_ad.ad.id, ad_group_ad.ad.image_ad.media_file from ad_group_ad
Then this gives: Unrecognized field in the query: 'ad_group_ad.ad.image_ad.media_file.id'.
select ad_group_ad.ad.id, ad_group_ad.ad.image_ad.media_file.id from ad_group_ad
And tried to remove all the prefixes from ad_group_ad.ad.image_ad.media_file.id
without any success. I also tried the ad_group_ad_asset_view
, but that returned empty response for all the customers I tried, and it also doesn't have a media file ID.
Is there a solution?