Create video ad

175 views
Skip to first unread message

Lena Grösch

unread,
Oct 26, 2022, 10:18:31 AM10/26/22
to Google Ads Scripts Forum
Hi, 

I am trying to create an video ad for a video campaign. 
But I can't figure out my issue with this Error: 
InputError: Invalid input: "{entity: an object}". 
Expected an Asset which is a YouTube video

That's the code I am using: 
//create asset for YouTube Video: 
    let assetOperation = AdsApp.adAssets().newYouTubeVideoAssetBuilder()
      .withName("AssetTest")
      .withYouTubeVideoId("XGozSElZqfA")
      .build();
     let videoAsset = assetOperation.getResult();
     Logger.log(videoAsset);  
     
     // create VideoAds  
     for (let k = 0; k < numberVideoAdsPerAdGroup; k++){

     let videoAd = videoAdGroup.newVideoAd()
       .inStreamAdBuilder()
       .withAdName("Test Ad 123")
       .withVideo(videoAsset)
       .withFinalUrl("www.prosieben.de")
       .withDisplayUrl("www.prosieben.de")
       .build()
       .getResult();
      Logger.log(videoAd.getErrors);
       
      let videoAdBuilt = AdsApp.Asset().videoAdOperation.getResult();

Lena Grösch

unread,
Nov 8, 2022, 6:06:53 AM11/8/22
to Google Ads Scripts Forum
Could someone help me with this case? Thank you. 

Google Ads Scripts Forum

unread,
Nov 9, 2022, 1:36:26 AM11/9/22
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/twLXe0KlnqE) from the forum as it wasn't routed to our support queue. 

Cheers, 
James
Google Ads Scripts Team

Google Ads Scripts Forum

unread,
Jan 17, 2023, 3:23:47 AM1/17/23
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/twLXe0KlnqE) from the forum as it wasn't routed to our support queue.

Regards,
Yasmin
Google Ads Scripts Team

Google Ads Scripts Forum Advisor

unread,
Jan 17, 2023, 5:37:29 AM1/17/23
to adwords...@googlegroups.com

Hi Lena,

 

Please excuse us for getting back just now as your message failed to be routed to our support queue. This is Yasmin from the Google Ads Scripts Team.

 

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.

 

Best regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2hzAxw:ref

Sergei Aleinik

unread,
Jan 17, 2023, 1:47:12 PM1/17/23
to Google Ads Scripts Forum
I confirm that it works in live-mode and it doesn't work in preview mode with respective error.

Honestly, the error in preview mode makes life more difficult while debugging/developing complex scripts for video campaigns. Could you please fix it?
вторник, 17 января 2023 г. в 14:37:29 UTC+4, adsscripts:

Google Ads Scripts Forum

unread,
Jan 24, 2023, 3:38:48 AM1/24/23
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/twLXe0KlnqE) from the forum as it wasn't routed to our support queue.

Regards,
Yasmin
Google Ads Scripts Team

Google Ads Scripts Forum Advisor

unread,
Jan 24, 2023, 5:35:08 AM1/24/23
to adwords...@googlegroups.com

Hi Lena,

 

Thank you for confirming that it works when run as well as for providing your insights on this.

 

I understand the inconvenience this situation has caused, but kindly note that the new script experience's behaviour is different when building as it relies on the Google Ads API validate-only mode. This means that, in most situations, the new experience is more closely aligned with how the script will actually run.

 

Let us know if we can assist you with anything else.

Reply all
Reply to author
Forward
0 new messages