Error of creating a google video ads

117 views
Skip to first unread message

Pavel

unread,
Aug 29, 2022, 10:34:26 AM8/29/22
to Google Ads Scripts Forum
Hello 
I'm using google ads scripts to create asset and video ad like this:
//create asset
const videoAssetOp = AdsApp.adAssets().newYouTubeVideoAssetBuilder()
                .withName(`${campaignID}-${adGroupID}-${crmVideo.youtube_video_id}`)
                .withYouTubeVideoId(crmVideo.youtube_video_id)
                .build();
const videoAsset = videoAssetOp.getResult();
//videoAsset.getYouTubeVideoId() returns the youtube video id i passed "crmVideo.youtube_video_id"
//but
//videoAsset.getType() returns "UNSPECIFIED"
//then create video ad
const videoAdOperation = videoAdGroup.newVideoAd().nonSkippableAdBuilder()
                .withAdName(`Video Ad ${crmVideo.youtube_video_id}`)
                .withFinalUrl(crmVideo.final_url)
                .withDisplayUrl(crmVideo.final_url)
                .withVideo(videoAsset)
                .build();
//here appears error
InputError: Invalid input: "{entity: an object}". Expected an Asset which is a YouTube video at La.check (adsapp_compiled:384:11) at EA.withVideo (adsapp_compiled:13936:36) at Object.<anonymous> (adsapp_compiled:18899:54)

Could you please advise?

Thank you!

Google Ads Scripts Forum Advisor

unread,
Aug 30, 2022, 2:32:48 AM8/30/22
to adwords...@googlegroups.com

Hello,

I’m James from the Google Ads scripts support team. Thank you for raising your concern to us.

Can you please provide us with the following items below so that we can check and validate this issue first?

  • Google Ads scripts CID / ID
  • Name of the script wherein the given code snippet is implemented

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2dokCQ:ref

Krishnadas D

unread,
Sep 13, 2022, 5:56:57 AM9/13/22
to Google Ads Scripts Forum
Now it seems to be working fine

i'll let you know if i get same kind of error again 

thanks 

Google Ads Scripts Forum

unread,
Sep 26, 2022, 2:31:52 AM9/26/22
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/NUB27JWerVA) from the forum as it wasn't routed to our support queue.

Regards,
Yasmin
Google Ads Scripts Team

Google Ads Scripts Forum

unread,
Sep 26, 2022, 6:23:20 AM9/26/22
to Google Ads Scripts Forum
Hi,

This is Yasmin from the Google Ads scripts team. I'm glad to know that the issue has been resolved on your end. Kindly let us know in the event that you would encounter an issue on your end again.

If the issue would still persist, we would appreciate it if you could provide the details my colleague, James, requested so we can further our investigation on the issue and assist you accordingly.

Thanks,

Yasmin
Google Ads Scripts Team

SUBIN P VASU

unread,
Jan 13, 2023, 7:39:51 AM1/13/23
to Google Ads Scripts Forum
How did it worked for you?

Google Ads Scripts Forum Advisor

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

Hi Subin,

 

This is Yasmin from the Google Ads Scripts Team.

 

Could you please confirm if you had encountered the same error that was described in this forum post? If yes, then I would kindly request to refrain from posting on multiple forum threads for better tracking of the issue on our end. It would also be much appreciated if we continue the conversation over at that thread as well.

 

We are hoping for your kind understanding on this.

 

Best regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


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