Re: I need help creating a video ad group through Scripts

95 views
Skip to first unread message

Tony Herman

unread,
Jan 24, 2022, 2:44:13 AM1/24/22
to googleadsscr...@google.com, adwords...@googlegroups.com
Please look into my issue

On Mon, Jan 24, 2022 at 6:30 AM Tony Herman <the...@digisay.me> wrote:
my account id 871-337-7627

and then the only script there named 
"Unnamed script" 



On Mon, Jan 24, 2022 at 6:29 AM Tony Herman <the...@digisay.me> wrote:
I get this error
script3.PNGscript1.PNGscript2.PNG

Here is my script


function main() {
   var youTubeVideoId = "lcdmDfGPeyU";
 var mediaOperation = AdsApp.adMedia().newVideoBuilder()
    .withYouTubeVideoId(youTubeVideoId)
    .build();
 var video = mediaOperation.getResult();
 
 
    //var v = campaign.getString('video_link');
      var mediaOperation = AdsApp.adMedia().newVideoBuilder()
       //.withYouTubeVideoId(v.split('=').pop())
       .withYouTubeVideoId("lcdmDfGPeyU")
       .build();
     var TryThis = mediaOperation.getResult();
 
 var VideoAdGroup = AdsApp.videoCampaigns().withCondition("Name=BushraHAGA").get().next().newVideoAdGroupBuilder().withAdGroupType("TRUE_VIEW_IN_STREAM").withName("GA4").build().getResult()
 
  var VideoAd = VideoAdGroup.newVideoAd().inStreamAdBuilder()
  VideoAd.withVideo(TryThis)
  VideoAd.withAdName("GLGLY3")
  VideoAd.withFinalUrl("https://www.youtube.com/watch?v=lcdmDfGPeyU")
  VideoAd.withDisplayUrl("youtube.com/watch?v=lcdmDfGPeyU")
  VideoAd.withCallToAction("PLAY NOW")
  VideoAd.build();
 Logger.log(VideoAd.build().getErrors())
  //var videos = AdsApp.adAssets().newYouTubeVideoAssetBuilder().withYouTubeVideoId("lcdmDfGPeyU").withName("dddd2").build()
 // Logger.log(videos)
 // Logger.log(videos.isSuccessful())
 // Logger.log(videos.getResult())
 
 // AdsApp.videoAdGroups().withCondition("Name=GALGLY2").get().next().newVideoAd().inStreamAdBuilder().withVideo(TryThis).withAdName("GLGLY2")
   // .withFinalUrl("https://www.youtube.com/watch?v=lcdmDfGPeyU")
    //.withDisplayUrl("youtube.com/watch?v=lcdmDfGPeyU")
  //  .withCallToAction("PLAY NOW")
   // .build()


           
}


  // You can filter on the YouTubeVideoId if you already have that video in
  // your account to fetch the exact one you want right away.


Tony Herman

unread,
Jan 24, 2022, 2:44:13 AM1/24/22
to adwords...@googlegroups.com

Tony Herman

unread,
Jan 24, 2022, 2:44:13 AM1/24/22
to adwords...@googlegroups.com
---------- Forwarded message ---------
From: Tony Herman <the...@digisay.me>
Date: Mon, Jan 24, 2022 at 6:30 AM
Subject: Re: I need help creating a video ad group through Scripts
To: <googleadsscr...@google.com>


my account id 871-337-7627

and then the only script there named 
"Unnamed script" 



Mincreajos

unread,
Mar 3, 2022, 7:20:58 PM3/3/22
to Google Ads Scripts Forum
Hi,

I have the same problem.

Any solution?

Thanks

Mincreajos

unread,
Mar 9, 2022, 5:40:24 AM3/9/22
to Google Ads Scripts Forum
Hi,

This problem is solved switching off google ads scripts beta experience.

Jose

Google Ads Scripts Forum Advisor

unread,
Mar 10, 2022, 1:44:43 AM3/10/22
to adwords...@googlegroups.com

Hello Jose,

I believe that I already addressed your query within our private channel. Having said that, if you have any further concern it would be best if we can continue our discussion to the original thread that you have created for better tracking of issues. 

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


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