No response when creating google youtube ads with youtube video asset

44 views
Skip to first unread message

Dihan Cheng

unread,
Jan 28, 2024, 9:27:16 AM1/28/24
to Google Ads API and AdWords API Forum
Hello support,

I'm trying to create an ad with the following code. The asset is created successfully, the ad is also created successfully. However, the line "videoAdOperation.getResult()" does not return anything, no result, not exception, nothing. The code just stops continuing. Could you help on this?

thanks!

        const assetOperation = AdsApp.adAssets().newYouTubeVideoAssetBuilder()
            .withName(assetName)
            .withYouTubeVideoId(assetVideoId)
            .build();

          Logger.log("Asset operation initiated");

          try {
            asset = assetOperation.getResult();
           
            if (asset) {
              Logger.log("Asset id is " + asset.getId());
              videoAdOperation = adGroup.newVideoAd()
                .nonSkippableAdBuilder()
                .withAdName(adName)
                .withDisplayUrl(videoDisplayUrl)
                .withFinalUrl(videoFinalUrl)
                .withVideo(asset)
                .build();

              Logger.log("New video ad creation initiated");
             
              videoAd = videoAdOperation.getResult();
              Logger.log("New ad created, ad id is " + videoAd.getId());
            } else {
              Logger.log("Asset is null or undefined");
            }
          } catch (e) {
            Logger.log("Error: " + e.message);
          }

Google Ads API Forum Advisor

unread,
Jan 29, 2024, 8:07:03 AM1/29/24
to adwor...@googlegroups.com
Hi,

Thank you for contacting the Google Ads API support team.

By reviewing your concern, I understand that the method videoAdOperation.getResult() is not returning any results. Could you please confirm whether you are using Google Ads API or Youtube data API? If you are using Google Ads API, kindly provide us with the complete API logs (request and response with request-id and request header) generated at your end.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.  
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02ryMBY:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages