Error creating ad from google script

61 views
Skip to first unread message

Carlos Rodriguez

unread,
Jun 21, 2022, 2:58:56 AM6/21/22
to Google Ads Scripts Forum
Hi, 
From a google script, I am trying to create an ad with YouTubeVideoId
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

SUBIN P VASU

unread,
Jan 13, 2023, 6:18:35 AM1/13/23
to Google Ads Scripts Forum
Hi,

Did it solved somehow?
I just came across similar scenario.

Google Ads Scripts Forum Advisor

unread,
Jan 16, 2023, 2:21:02 AM1/16/23
to adwords...@googlegroups.com

Hello Subin,

 

Yasmin here from the Google Ads Scripts Team.

 

Can you please confirm if you've encountered the exact same issue that's described in this thread? If yes, could you please provide more context to the issue you've encountered? It would be much appreciated if you could provide the following information so we could further investigate your concern and assist you:

  • Google Ads account ID or CID
  • Script name
  • Screenshot of the error
  • Shareable link of the spreadsheet the script is using (You may follow this guide under Share a file publicly

 

Kindly send the requested items via `Reply privately to author` option. If the said option is not available on your end, you may send those through the email alias `googleadsscr...@google.com` instead.

 

However, if you did not encounter this exact scenario, kindly open a new thread with your concern for better tracking of the issue on our end.

 

Best regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2hy5CZ:ref

SUBIN P VASU

unread,
Jan 16, 2023, 5:16:51 AM1/16/23
to Google Ads Scripts Forum
I Just relied privately to the address. Please check and let me know

On Monday, 16 January 2023 at 12:51:02 UTC+5:30 adsscripts wrote:

Hello Subin,

 

Yasmin here from the Google Ads Scripts Team.

 

Can you please confirm if you've encountered the exact same issue that's described in this thread? If yes, could you please provide more context to the issue you've encountered? It would be much appreciated if you could provide the following information so we could further investigate your concern and assist you:

  • Google Ads account ID or CID
  • Script name
  • Screenshot of the error
  • Shareable link of the spreadsheet the script is using (You may follow this guide under Share a file publicly

 

Kindly send the requested items via `Reply privately to author` option. If the said option is not available on your end, you may send those through the email alias `googleadsscripts-support@google.com` instead.

Google Ads Scripts Forum Advisor

unread,
Jan 17, 2023, 2:07:26 AM1/17/23
to adwords...@googlegroups.com

Hi Subin,

 

Thank you for providing the information I had requested.

 

Upon my initial investigation of your concern, could you please confirm if you are encountering the behaviour when generating the script in Preview Mode? Kindly try generating the script (by running it) using a sample video campaign and let us know how it goes on your end.

SUBIN P VASU

unread,
Jan 18, 2023, 4:38:47 AM1/18/23
to Google Ads Scripts Forum
Great!!
It's working when Run.
Thanks :)
Reply all
Reply to author
Forward
0 new messages