Error message "Cannot create already deprecated ads" when using ResponsiveDisplayAdBuilder

3,609 views
Skip to first unread message

Remco Rowaan

unread,
Jul 30, 2019, 12:07:18 PM7/30/19
to Google Ads Scripts Forum
I'm trying to create Responsive Display Ads by using the ResponsiveDisplayAdBuilder, but when i'm running my script I get the error message "Cannot create already deprecated ads". I'm using the sample script for Responsive Display Ads on this page: https://developers.google.com/google-ads/scripts/docs/examples/ads. I've combined it with the ImageBuilder two upload and create 2 images to add to the ad.

I would like to know if I'm doing something wrong or if the ResponsiveDisplayAdBuilder is just outdated (and I need to use a different one?). Thank you!

Google Ads Scripts Forum Advisor Prod

unread,
Jul 30, 2019, 4:10:12 PM7/30/19
to adwords-scripts+apn2wqe9bfw-y_tz...@googlegroups.com, adwords-scripts+apn2wqe9bfw-y_tz...@googlegroups.co, adwords...@googlegroups.com
Hi Remco,

Can you please post your code in full? Alternatively, you can provide your CID and script name and I'll be able to investigate the issue directly in your account.

Regards,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5001UEHBre:ref

Remco

unread,
Aug 5, 2019, 6:01:41 AM8/5/19
to Google Ads Scripts Forum
So a few things:
- I can only reply in public to my own message, not to Matt's reply.
- I've replied to Matt's request in private, but except for a Google test script that I see added in my account (which is the same as mine and doesn't work), I haven't heard anything from Matt. I've send Matt a second message in private already, but to no avail.

I'm posting the script in full here now (anonymised it). Your help is really appreciated Thank you!

function main() {
  // If you have multiple adGroups or images with the same name, this
  // snippet will pick an arbitrary match each time. In such cases, just
  // filter on the campaign name or media ID as well:
  //
  // AdsApp.adGroups()
  //     .withCondition('Name = "Test Group for Responsive Display Ads"')
  //     .withCondition('CampaignName = "Example Campaign Name"')
  var adGroupIterator = AdsApp.adGroups()
      .withCondition('Name = "Test Group for Responsive Display Ads"')
      .withCondition('CampaignName = "Example Campaign Name"')
      .get();
  
  // Upload a marketing image
  var imageUrl = "https://example.com/image.jpg";
  var imageBlob = UrlFetchApp.fetch(imageUrl).getBlob();
  var mediaOperation = AdsApp.adMedia().newImageBuilder()
      .withName("marketingImage1")
      .withData(imageBlob)
      .build();
  var marketingImage = mediaOperation.getResult();
  
  marketingImage
  
  // Upload a square marketing image
  var imageUrl = "https://example.com/image.jpg";
  var imageBlob = UrlFetchApp.fetch(imageUrl).getBlob();
  var mediaOperation = AdsApp.adMedia().newImageBuilder()
      .withName("squareMarketingImage1")
      .withData(imageBlob)
      .build();
  var squareMarketingImage = mediaOperation.getResult();
  
  squareMarketingImage
  
  var mediaIterator = AdsApp.adMedia().media()
      .withCondition('Name CONTAINS "Image1"')
      .get();
  if (adGroupIterator.hasNext() && mediaIterator.hasNext()) {
    var adGroup = adGroupIterator.next();
    var marketingImage = mediaIterator.next();
    adGroup.newAd().responsiveDisplayAdBuilder()
        .withShortHeadline('Short headline')
        .withLongHeadline('Long headline')
        .withDescription('Description')
        .withBusinessName('Business name')
        .withMarketingImage(marketingImage)
        .withMarketingImage(squareMarketingImage)
        .withFinalUrl('http://www.example.com')
        .build();
    // ResponsiveDisplayAdBuilder has additional options.
    // For more details, see
  }
}...


Google Ads Scripts Forum Advisor Prod

unread,
Aug 5, 2019, 2:36:42 PM8/5/19
to adwords-scripts+apn2wqe9bfw-y_tz...@googlegroups.com, adwords-scripts+apn2wqe9bfw-y_tz...@googlegroups.co
Hi Remco,

Thanks for your patience on this. We seem to be having an issue with private replies on the forum. Please see my reply below:

The error your received was of this type.

In February of this year, we made some changes related to responsive display ads. Here is the relevant part of the blog post:

AdGroupAdService requests that attempt to create a ResponsiveDisplayAd will fail with the error AdGroupAdError.CANNOT_CREATE_DEPRECATED_ADS. The API will continue to allow you to remove ResponsiveDisplayAds and modify the status of existing ads.
We do not have a current workaround for creating responsive display ads in scripts at the moment. However, existing responsive display ads can still be removed/edited. 

Our blog will have any responsive display ad relevant updates.
Reply all
Reply to author
Forward
0 new messages