Responsive video ad creation stopped working

143 views
Skip to first unread message

Adam Nagy

unread,
May 13, 2022, 10:14:21 AM5/13/22
to Google Ads Scripts Forum
Hi Google Ads Scripts Technical Support Team,

I have a script that ran successfully months ago, but now it yields the infamous InternalApiError.UNKNOWN, and can't create Responsive ads anymore.

Link to the script:


User id: 581-095-7480

My email address is: adam...@smartly.io

Thanks, 
Adam

Code for the script
function getVideoByYouTubeIdOrErrors(id) {
  try {
    var video;
    var assetIterator = AdsApp.adAssets()
    .assets()
    .withCondition("YouTubeVideoId = '" + id + "'")
    .get();
    if (assetIterator.hasNext()) {
      video = assetIterator.next();
    } else {
      var assetOperation = AdsApp.adAssets().newYouTubeVideoAssetBuilder()
      .withYouTubeVideoId(id)
      .build();
      if (!assetOperation.isSuccessful()) {
        return { errors: assetOperation.getErrors() };
      }
      video = assetOperation.getResult();
    }
    return video;
  } catch (e) {
    Logger.log("error: " + e.message + " " + e.stack);
    return { errors: [e.message] };
  }
}

function responsive() {
  var videoAdGroupIterator = AdsApp.videoAdGroups()
  .withCondition('Name = "e2e-tests-responsive-ad-group"')
  .get();
  if (!videoAdGroupIterator.hasNext()) {
    Logger.log('ad group not found');
    return;
  }

  var videoAdGroup = videoAdGroupIterator.next();

  Logger.log('videoAdGroup');  
  Logger.log(videoAdGroup);
  Logger.log(videoAdGroup.getId());
  Logger.log(videoAdGroup.getName());

  var youTubeVideoId = "nWelwegrNfQ";
  // var youTubeVideoId = 'jyiov1-gUb0';
  var videoOrErrors = getVideoByYouTubeIdOrErrors(youTubeVideoId);
  if (videoOrErrors.errors) {
    Logger.log('videoOrErrors error');
    Logger.log(videoOrErrors.errors);
    return;
  }
  Logger.log('videoOrErrors');
  Logger.log(videoOrErrors);
  Logger.log(videoOrErrors.getId());


  var builder = videoAdGroup
  .newVideoAd()
  .responsiveVideoAdBuilder()
  .withAdName('Testing gScript ad responsive')
  .withCallToAction('CTA')
  .withDescription('description')
  .withFinalUrl('https://example.com/')
  .withVideo(videoOrErrors)
  .withHeadline('Headline')
  .withLongHeadline('Long Headline');

  var adResult = builder.build();
  if (!adResult.isSuccessful()) {
    Logger.log('error:');
    Logger.log(adResult.getErrors());
    return;
  }
  Logger.log('result:');
  Logger.log(adResult.getResult());

}

function main() {
  responsive();
}

Adam Nagy

unread,
May 14, 2022, 3:24:14 AM5/14/22
to Google Ads Scripts Forum
UPDATE: Non-skippable ads are also affected, can't create ads vie the API. 

Google Ads Scripts Forum Advisor

unread,
May 17, 2022, 5:30:19 AM5/17/22
to adwords...@googlegroups.com
Hi Adam,

For us to investigate this further, could you kindly share your CID and script name where the issue is reproducible?

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2asdjq:ref

Adam Nagy

unread,
May 17, 2022, 6:39:37 AM5/17/22
to Google Ads Scripts Forum
Hi Teejay,

Script name:  Adam test video creation

I'm not sure what CID is, so here are some guesses:
  • 596456040 (that's the ocid from the URL-s above)
  • 8382598406 (that's the __u from the URL-s above)
  • 2963377960 (that's the __c from the URL-s above)
  • 581-095-7480: Smartly.io development user id form the message above
  • 5231178 (that's the script id, from the script URL above)
Let me know if the cid you mentioned is not in the list.

After some investigation my best guess is there is some policy that is preventing the ad creation, because when I tried to create with the same code a new ad in a freshly created campaign/ad group, it worked out fine. Do you know which policy/rule is that? Or is it something else?

Google Ads Scripts Forum Advisor

unread,
May 19, 2022, 1:42:50 AM5/19/22
to adwords...@googlegroups.com
Hi Adam,

Thank you for providing additional context. For finding your CID, you may check this guide.

Adam Nagy

unread,
May 23, 2022, 3:36:32 AM5/23/22
to Google Ads Scripts Forum
Hi Teejay,
  • Customer ID: 581-095-7480
  • Script name:  Adam test video creation
    Thanks,
    Adam

    Google Ads Scripts Forum Advisor

    unread,
    May 24, 2022, 4:42:44 AM5/24/22
    to adwords...@googlegroups.com
    Hi Adam,

    Thank you for providing the requested information. I was able to confirm the reported issue on my end and toggling off the new experience work fine.  With that said, let me share this to the rest of the team for further investigation. I'll update this thread the soonest the team share their feedback.

    Adam Nagy

    unread,
    Jun 7, 2022, 3:19:02 AM6/7/22
    to Google Ads Scripts Forum
    Hi Teejay,

    Any updates on the topic?

    Google Ads Scripts Forum Advisor

    unread,
    Jun 7, 2022, 6:08:25 AM6/7/22
    to adwords...@googlegroups.com

    Hello Adam,

    James here, also from the Google Ads scripts support team. Thank you for your patience.

    I would like to inform you that this error is coming from below our library. We don't do any validation checks on resource limits. As per our team’s checking, we see that your account has 300 enabled video ads in the ad group. Based on this guide, user accounts are limited to 50 ads per ad group (except image ads, but that's not relevant here).  Way back in march, we believed that we enforced the limit on video creatives per ad group. So that is the main reason why it causes an error on your end.

    If you  need to run 300 video ads, you’ll need to spread them across multiple ad groups.

    Hope this helps. Let me know if you have any questions.

    Regards,

    Google Logo
    James Howell
    Google Ads Scripts Team
     


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