Error creating google ads with youtube video asset

227 views
Skip to first unread message

Carlos Rodriguez

unread,
Jun 8, 2022, 11:02:51 AM6/8/22
to Google Ads API and AdWords API Forum
Hi, 
I am trying to create an ad with YouTubeVideoId using google script. First, I create a youtube video asset:
>> result =  AdsApp.adMedia().newVideoBuilder() .withYouTubeVideoId(youtubeVideoId).build().getResult()

result.isSucessful() is True, result.getErrors() is an empty list, result.getEntityType() is 'Asset' but result.getType() is  UNSPECIFIED

If I try to create the ad:
 new_ad = adGroup.newVideoAd().inStreamAdBuilder().withAdName(ad_name).withVideo(result)
I get:
 >> InputError: Invalid input: "{entity: an object}". Expected an Asset which is a YouTube video

This last error can be explained because the asset has UNSPECIFIED type, but why the asset has this type?

Thanks

Carlos
    

Google Ads API Forum Advisor

unread,
Jun 8, 2022, 3:44:52 PM6/8/22
to adwor...@googlegroups.com

Hello Carlos,

Thanks for reaching out to the Google Ads API forum.
For us to investigate, could you please provide us with the complete request and response logs with request-id and request-header generated on your end, so that our team may take a closer look at the issue you’re experiencing.

For the client library, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.

Please send the requested details via the Reply privately to the author option. If this option is not available, you may send the details directly to our googleadsapi-support@google.com alias by referring to this thread.

Best Regards,

Google Logo
Jakeia
Google Ads API Team


ref:_00D1U1174p._5004Q2bdan7:ref

charlesb...@gmail.com

unread,
May 9, 2023, 12:13:21 PM5/9/23
to Google Ads API and AdWords API Forum
Hi,

Was there any update on this?

I have the exact same error.

I'm definitely passing in a video asset but receive the error "Expected an Asset which is a YouTube video".

Is it just not supported?

Thanks

On Wednesday, 8 June 2022 at 14:44:52 UTC-5 Google Ads API Forum Advisor wrote:

Hello Carlos,

Thanks for reaching out to the Google Ads API forum.
For us to investigate, could you please provide us with the complete request and response logs with request-id and request-header generated on your end, so that our team may take a closer look at the issue you’re experiencing.

For the client library, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.

Please send the requested details via the Reply privately to the author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias by referring to this thread.

Best Regards,

charlesb...@gmail.com

unread,
May 9, 2023, 12:28:45 PM5/9/23
to Google Ads API and AdWords API Forum
Hi,

Sorry, I actually managed to sort this.

I was also using scripts but it should be the same idea.

I first created the video asset using adMedia() i.e. not adAssets() which didn't work.
Then I created the media by running the script.
Finally I got the asset via an iterator and created the advert successfully.

I imagine it's the same deal with the API.

Thanks

Google Ads API Forum Advisor

unread,
May 9, 2023, 2:32:19 PM5/9/23
to charlesb...@gmail.com, adwor...@googlegroups.com

Hi there,

We are glad to know that you managed to sort out on your end. However, feel free to open a new forum thread if you have any other concerns related to the Google Ads API. 

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2bdan7:ref
Reply all
Reply to author
Forward
0 new messages