Unable to create new RSA (TypeError: Cannot find default value for object.)

101 views
Skip to first unread message

Thao Pham

unread,
Feb 27, 2020, 4:26:09 AM2/27/20
to Google Ads Scripts Forum
Hello all.
Im trying to create new RSAs for my adgroup.
the code is as simple as below
(before that I already define headline 1, headline 2, headline 3 etc.
The script worked fine with creating new ETA, but spit out error for new RSA
The error is TypeError: Cannot find default value for object.

What went wrong please?

function AdBuilder(adgroup) {
               
       
var adOperation = adgroup.newAd().expandedTextAdBuilder() //creating a new ad
         
.withHeadlinePart1(headline1)
         
.withHeadlinePart2(headline2)
         
.withHeadlinePart3(headline3)
         
.withDescription(d1)
         
.withPath1(path1)
         
.withPath2(path2)
         
.withFinalUrl(Finalurl)
         
.build();
       
       
var adOperation2 = adgroup.newAd().responsiveSearchAdBuilder() // creating new RSA
         
.addheadline(headline1, "HEADLINE_1")
         
.addHeadline(headline2)
         
.addHeadline(headline3)
         
.addHeadline(headline4)
         
.withDescriptions([
            d1
,
            d2
         
])
         
.withPath1(path1)
         
.withPath2(path2)
         
.withFinalUrl(Finalurl)
         
.build();
       
//var ad2 = adOperation.getResult();
     
}

Tadhg Deeney

unread,
Feb 27, 2020, 5:44:34 AM2/27/20
to Google Ads Scripts Forum
Hi there, 

I think you need to add with Headlines instead of just adding the headline directly:
var rsa = adgroup.newAd().responsiveSearchAdBuilder()
       
.withHeadlines([h[0],h[1], h[2], h[3], h[4], h[5], h[6], h[7], h[8], h[9]])
       
.withDescriptions([{d[0], d[1], d[2]])
       
.withPath1(p1)
       
.withPath2(p2)
       
.withFinalUrl(rsaURL)
       
.build();

Google Ads Scripts Forum Advisor

unread,
Feb 27, 2020, 5:55:55 AM2/27/20
to adwords...@googlegroups.com
Hi,

Thanks for posting your concern.

Please note that the methods for responsive search ad builder are case sensitive, you may apply the correct methods based on this guide and re-execute the script.

If the error persists after the modification, please provide the customer ID and the name of the script so I can further investigate. You can provide it via Reply privately to author option.

Regards,
Ejay
Google Ads Scripts Team

ref:_00D1U1174p._5001UXTPna:ref

Thao Pham

unread,
Feb 28, 2020, 2:04:30 AM2/28/20
to Google Ads Scripts Forum
Thank you so much!!!
Turns out it really was just my capitalization... fixed it and it ran now!

Google Ads Scripts Forum Advisor

unread,
Feb 28, 2020, 5:57:27 AM2/28/20
to adwords...@googlegroups.com
Hi,

I am happy to know that your script is now working.

Let me know if you have further concerns and I will be happy to provide support.
Reply all
Reply to author
Forward
0 new messages