Responsive Search Ads selector won't return headline or description text - returns "TypeError: Cannot find function map in object LiteArray." instead.

135 views
Skip to first unread message

Jonathan Pearson

unread,
Oct 4, 2019, 4:03:16 AM10/4/19
to Google Ads Scripts Forum

I'm running a script that uses the headline and description fields from the Responsive Search Ads.

 

It was working absolutely fine until yesterday evening, when suddenly a mysterious error appeared:

 

"TypeError: Cannot find function map in object LiteArray."

 

This appears to relate to the method by which headlines (and descriptions) are identified within the fields of the ad, which looks like this in the code:

 

ad.asType().responsiveSearchAd().getHeadlines()

 

This worked fine before, but now is throwing the error above. Same for descriptions. Although paths and URLs, somewhat oddly, can still be returned without issue.

 

I'm really baffled - the script was working and unchanged, and then suddenly stopped working last night without anything being done to it. I suspect that perhaps the taxonomy of how to acquire the text fields of an RSA ad have changed or been removed, although it's not obvious how they can now be accessed if so.

 

Any ideas as to what's going wrong would be welcome - I've included a short version of the code, which throws the same error, below, for reference:

 

"function main() {

 

  var adSelector = AdWordsApp

  .ads()

  .withCondition("CampaignStatus != REMOVED")

  .withCondition("AdGroupStatus != REMOVED")

  .withCondition("AdType = VERSATILE_TEXT_AD")

  .orderBy("AdGroupId ASC")       

  var adIterator           = adSelector.get();

 

  while (adIterator.hasNext()) {

    var ad                = adIterator.next();

    var adId              = ad.getId();

    var adIsPaused        = ad.isPaused();

 

    var adgroupId         = ad.getAdGroup().getId();

 

    Logger.log(ad.asType().responsiveSearchAd().getHeadlines());

  }  

}"

Google Ads Scripts Forum Advisor

unread,
Oct 4, 2019, 6:47:35 AM10/4/19
to adwords...@googlegroups.com
Hi Jonathan,

Thanks for posting your concern.

So that I can take a closer look to your issue regarding the Responsive Search Ads, could you provide the customer ID and the name of the script where you encountered the error? You may send the requested information via Reply privately to author option.

Regards,
Ejay
Google Ads Scripts Team

ref:_00D1U1174p._5001UKMAsF:ref

Jonathan Pearson

unread,
Oct 4, 2019, 12:00:51 PM10/4/19
to Google Ads Scripts Forum
Hi Ejay,

I managed to solve this by getting the same information (headlines, descriptions, paths, and URLs, etc.) via the reporting route instead, so the script is completely updated now with the solution in place - and actually running faster as a result!

However, it was a really odd error and one I assume that must have been the result of somehow being caught in the middle of some kind of deprecation of the elements of the responsive search ads.

Many thanks,

JP

Google Ads Scripts Forum Advisor

unread,
Oct 7, 2019, 3:29:44 AM10/7/19
to adwords...@googlegroups.com
Hi Jonathan,

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

Let me know if you encounter any issues and I will be happy to provide further support.

Naman Jindal

unread,
Oct 28, 2019, 12:06:51 PM10/28/19
to Google Ads Scripts Forum
Hello Team,

Jonathan found a workaround but this error still needs to be resolved, right?

Thanks,
Naman

Евгений Некрасов

unread,
Oct 28, 2019, 12:09:00 PM10/28/19
to Naman Jindal via Google Ads Scripts Forum

Проблема еще не решена! Её надо решить!

--
Отправлено из Mail.ru для Android

понедельник, 28 октября 2019г., 22:06 +06:00 от Naman Jindal via Google Ads Scripts Forum adwords-scripts+APn2wQctnj_5NwtO...@googlegroups.com:

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/cd4736ed-271c-45d5-be4b-f7dc93c07c36%40googlegroups.com.

Google Ads Scripts Forum Advisor

unread,
Oct 28, 2019, 11:22:25 PM10/28/19
to adwords...@googlegroups.com

Hi Naman,

Could you confirm if you are encountering the same error TypeError: Cannot find function map in object LiteArray. that Jonathan encountered? If yes, so that I can further investigate the issue, could you provide your CID and script name via Reply privately to author? I was not able to replicate the error with the script that Johnathan provided previously.

Hi Евгений Некрасов,

Thank you for posting and I'm sorry that we only provide support in English.

Could you confirm if you are encountering the same error above? If yes, could you provide your CID and script name via Reply privately to author? Otherwise, please create a new forum thread for new topics for better tracking and we'll gladly assist you.

Regards,
Hiroyuki
Google Ads Scripts Team



ref:_00D1U1174p._5001UKMAsF:ref

Naman Jindal

unread,
Oct 29, 2019, 3:38:16 AM10/29/19
to Google Ads Scripts Forum
Yes. I got the same error. I will send you the CID.

Thanks
Screenshot 2019-10-29 at 1.07.21 PM.png

Google Ads Scripts Forum Advisor

unread,
Oct 29, 2019, 4:40:24 AM10/29/19
to adwords...@googlegroups.com

Hi Naman,

Thank you for providing the additional information privately.

I was able to replicate the issue. With this, I will file a bug for this error and we'll let you know once updates are available.



Regards,
Hiroyuki
Google Ads Scripts Team



ref:_00D1U1174p._5001UKMAsF:ref

Google Ads Scripts Forum Advisor

unread,
Oct 30, 2019, 1:28:08 AM10/30/19
to adwords...@googlegroups.com

Hi everyone,

We would like to inform you that the issue with Responsive Search Ads that shows TypeError: Cannot find function map in object LiteArray. has now been fixed.

Please inform us if you still encounter the error on your end.



Regards,
Hiroyuki
Google Ads Scripts Team



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